منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   Register Npc : ان بي سي عمل اكونت (https://code.vpscairo.com/showthread.php?t=3238)

Commander 2019-12-06 11:00 PM

Register Npc : ان بي سي عمل اكونت
 
بسم الله الرحمن الرحيم
انا لقيت ان بي سي تسجيل نازل مع احترامي للشخص الي منزلو تكويده غلط فا قولت اعمل واحد وانزلو لاي حد يستفاد بيه
كود PHP:

#region Register Commander
                
case 764738:
                    {
                        switch (
npcRequest.OptionID)
                        {
                            case 
0:
                                {
                                    
dialog.Text("I`m HelpDesk I'M Here For Your Help ");
                                    
dialog.Option("Register Account"1);
                                    
dialog.Avatar(7070);
                                    
dialog.Send();
                                    break;
                                }
                            case 
1:
                                {
                                    
dialog.Text("Please insert UserName");
                                    
dialog.Input("here:"28);
                                    if (
npcRequest.Input.Length 8)
                                    {
                                        
dialog.Text("Max Letter 8");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
dialog.Send();
                                    break;
                                }
                            case 
2:
                                {
                                    
string username npcRequest.Input;
                                    
MySqlCommand cmd2 = new MySqlCommand(MySqlCommandType.SELECT).Select("accounts").Where("Username"username);//debug and test!
                                    
MySqlReader r = new MySqlReader(cmd2);
                                    if (!
r.Read())//wait
                                    
{
                                        
client.Username username;
                                    }
                                    else
                                    {
                                        
dialog.Text("UserName Is Already Here");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
dialog.Text("Please insert Password");
                                    
dialog.Input("here:"314);
                                    if (
npcRequest.Input.Length 14)
                                    {
                                        
dialog.Text("Max Letter 14");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }                                 
                                    break;
                                }
                            case 
3:
                                {
                                    
string password npcRequest.Input;
                                    
client.Password password;
                                    
using (var cmd = new MySqlCommand(MySqlCommandType.INSERT))
                                        
cmd.Insert("accounts").Insert("Username"client.Username)
                                        .
Insert("Password"client.Password).Insert("IP"client.Account.IP)
                                        .
Execute();
                                    
client.Username "";
                                    
client.Password "";
                                    
dialog.Text("Register Successfully Done");
                                    
dialog.Option("Thanks."255);
                                    
dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
               
#endregion 

روح كلاس
كود PHP:

 GameState Or GameClient 

حط ده
كود PHP:

#region Register
        
public string Username;
        public 
string Password;
       
        
#endregion 

بس كدا الانبي سي شغال ومفهوش غلطات ان شاء الله ولو حد لقي غلطه يقولي وهصلحها في ساعتها

Hassan Emprator 2019-12-06 11:32 PM

رد: Register Npc : ان بي سي عمل اكونت
 
تسلم ايدك يحب

ahmedfathy 2019-12-07 02:53 AM

رد: Register Npc : ان بي سي عمل اكونت
 
الله ينور عليك احسنت هو دا الشغل ولا بلاش كفاية بقي copy

nova 2019-12-07 02:58 AM

رد: Register Npc : ان بي سي عمل اكونت
 
هو ينفع تزود خانة للسؤال والجواب وخانة للجىى ميل بحيث يبقا موجود معاه الداتا مش الاسم والباص بس ؟

Commander 2019-12-07 11:01 AM

رد: Register Npc : ان بي سي عمل اكونت
 
اقتباس:

المشاركة الأصلية كتبت بواسطة ahmedfathy (المشاركة 24336)
الله ينور عليك احسنت هو دا الشغل ولا بلاش كفاية بقي copy

حبيبي

Commander 2019-12-07 11:04 AM

رد: Register Npc : ان بي سي عمل اكونت
 
اقتباس:

المشاركة الأصلية كتبت بواسطة nova (المشاركة 24338)
هو ينفع تزود خانة للسؤال والجواب وخانة للجىى ميل بحيث يبقا موجود معاه الداتا مش الاسم والباص بس ؟

ينفع عنيا هفطر واعملهولك

nova 2019-12-07 02:35 PM

رد: Register Npc : ان بي سي عمل اكونت
 
اقتباس:

المشاركة الأصلية كتبت بواسطة Commander (المشاركة 24362)
ينفع عنيا هفطر واعملهولك

تسلملى عينك

Commander 2019-12-08 12:01 AM

رد: Register Npc : ان بي سي عمل اكونت
 
اقتباس:

المشاركة الأصلية كتبت بواسطة nova (المشاركة 24374)
تسلملى عينك

كود PHP:

#region Register Commander
                
case 764738:
                    {
                        switch (
npcRequest.OptionID)
                        {
                            case 
0:
                                {
                                    
dialog.Text("I`m HelpDesk I'M Here For Your Help ");
                                    
dialog.Option("Register Account"1);
                                    
dialog.Avatar(7070);
                                    
dialog.Send();
                                    break;
                                }
                            case 
1:
                                {
                                    
dialog.Text("Please insert UserName");
                                    
dialog.Input("here:"28);
                                    if (
npcRequest.Input.Length 8)
                                    {
                                        
dialog.Text("Max Letter 8");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
dialog.Send();
                                    break;
                                }
                            case 
2:
                                {
                                    
string username npcRequest.Input;
                                    
MySqlCommand cmd2 = new MySqlCommand(MySqlCommandType.SELECT).Select("accounts").Where("Username"username);//debug and test!
                                    
MySqlReader r = new MySqlReader(cmd2);
                                    if (!
r.Read())//wait
                                    
{
                                        
client.Username username;
                                    }
                                    else
                                    {
                                        
dialog.Text("UserName Is Already Here");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
dialog.Text("Please insert Password");
                                    
dialog.Input("here:"314);
                                    if (
npcRequest.Input.Length 14)
                                    {
                                        
dialog.Text("Max Letter 14");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }                                 
                                    break;
                                }
                            case 
3:
                                {
                                    
string password npcRequest.Input;
                                    
client.Password password;
                                    
dialog.Text("Please insert Email");
                                    
dialog.Input("here:"425);
                                    
dialog.Send();
                                    if (
npcRequest.Input.Length 25)
                                    {
                                        
dialog.Text("Max Letter 25");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }          
                                    
                                    break;
                                }
                            case 
4:
                                {
                                    
string Email npcRequest.Input;
                                    
client.Email Email;
                                    
dialog.Text("Please insert Mobilenumber");
                                    
dialog.Input("here:"525);
                                    
dialog.Send();
                                    if (
npcRequest.Input.Length 25)
                                    {
                                        
dialog.Text("Max Letter 25");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }

                                    break;
                                }
                            case 
5:
                                {
                                    
string mobilenumber npcRequest.Input;
                                    
client.mobilenumber mobilenumber;
                                    
dialog.Text("Please insert Code");
                                    
dialog.Input("here:"625);
                                    
dialog.Send();
                                    if (
npcRequest.Input.Length 25)
                                    {
                                        
dialog.Text("Max Letter 25");
                                        
dialog.Option("ok"255);
                                        
dialog.Send();
                                        return;
                                    }

                                    break;
                                }
                            case 
6:
                                {
                                    
string Code npcRequest.Input;
                                    
client.Code Code;
                                    
using (var cmd = new MySqlCommand(MySqlCommandType.INSERT))
                                        
cmd.Insert("accounts").Insert("Username"client.Username)
                                        .
Insert("Password"client.Password).Insert("MacAddress"client.Account.MacAddress).Insert("IP"client.Account.IP)
                                        .
Insert("Email"client.Email).Insert("MobileNumber"client.mobilenumber).Insert("Code"client.Code).Execute();
                                    
client.Username "";
                                    
client.Password "";
                                    
client.Email "";
                                    
client.mobilenumber "";
                                    
client.Code "";
                                    
dialog.Text("Register Successfully Done");
                                    
dialog.Option("Thanks."255);
                                    
dialog.Send();

                                    break;
                                }
                          
                        }
                        break;
                    }
               
#endregion 

وحط دول في كلاس
كود PHP:

gamestate 

كود PHP:

        #region Register
        
public string Username;
        public 
string Password;
        public 
string Email;
        public 
string mobilenumber;
        public 
string Code;
       
        
#endregion 



الساعة الآن 10:14 AM

مرحبا بكم في منتدي اكواد لتطوير الالعاب