السلام عليكم ورحمة الله وبركاته
اليوم اتسليت مع انبي سي كده وعارفه انه ايكون مفيد ليكم
الانبي سي عباره عن راجل اتكتب الكارت والايتم الي انت عايزه
طبعا علشان منقترش في الكلام مع الانبي سي لغيت خانه اكتب اسمك ده وخليت اسمه يتكتب لوحديه في الاضافه
الجديد بقا حاجه بسيطه جدا انت اول ماتروح تعمل طلبك للجي ام
تقدر تتابع طلبك اذا اتشحن ولا لا
ازاي ده طيب شوف ياريس
ده صور
اول ما تكلمه في خيار اسمه my shopinh مشترياتي
بعدين اتلقي المشتريات بتاعتك

في الصوره ده اتلقي الايتم الي انت كتبته مع الكارت وفي جنبيه كلمه wating ياعني منتظر انه يتشحن لو Done كده يكون الكارت اتشحن لو Error كده الكارت غلط
طبعا الفكره كله بسيطه بس مفيده جدا علشان الاعب يعرف لو الكارت اتشحن ولا لا
وقريبا اربط الانبي سي ده مع سكربت شحن الاصدار ال 3
يلا نشتغل بقا

في كلاس GameState
ضيف دول
كود:
#region Charge
public string Username;
public string Numberofcard;
public string Numberofitem;
#endregion
وده الانبي سي
كود:
#region Charge System
case 300121:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Welcome to the EgyArmy-Co[Helpdesk]. Do you want to charge?");
dialog.Option("Charge", 1);
dialog.Option("Items", 55);
dialog.Option("My shoping", 56);
dialog.Option("Not now.", 255);
dialog.Avatar(175);
dialog.Send();
break;
}
case 1:
{
dialog.Text("Welcome to the helpdesk. Do you want to charge?");
dialog.Option("yes", 100);
dialog.Option("Not Now", 255);
dialog.Avatar(0x5f);
dialog.Send();
break;
}
case 55:
{
dialog.Text("Copythe code Items And Past In Check box charge?");
dialog.Option("[cps] 1.000.000 CPS", 102);
dialog.Option("[item1] Soul P7", 102);
dialog.Option("Back*To*charge", 255);
dialog.Send();
break;
}
case 56:
{
dialog.Text("your bag from shoping?");
using (var command = new Database.MySqlCommand(Database.MySqlCommandType.SELECT))
{
command.Select("charge").Where("UID", client.Player.UID);
using (var reader = new Database.MySqlReader(command))
{
while (reader.Read())
{
dialog.Option(" " + reader.ReadString("Numberofitem") + " [ " + reader.ReadString("case_card") + " ] ", 102);
}
}
}
dialog.Option("Back*To*charge", 255);
dialog.Send();
break;
}
case 100://New Charge
{
dialog.Text("Hello. I'm the one that was choosen to Make your Charge.");
dialog.Option("I want to Charge.", 102);
dialog.Option("Nooooo.", 255);
dialog.Send();
break;
}
////////////////////////////////////////////
/*case 102:
{
dialog.Text("Please insert the Your Account Name If you Want now to charge for.");
dialog.Input("Here:", 106, 16);
dialog.Option("Forget it.", 110);
dialog.Send();
break;
}
//////////////////////////////////////////////////
case 102:
try
{
string Username;
Username = npcRequest.Input;
client.Username = Username;
if (!Exists(Username))
{
dialog.Text("Please insert Card Number .");
dialog.Input("Here:", 107, 14);
dialog.Option("No.", 255);
}
else
{
dialog.Text("Account Name already Exit.");
dialog.Option("Alright.", 255);
}
dialog.Send();
break;
}
catch
{
dialog.Text("Please write the correct value.");
dialog.Option("Try Again.", 102);
dialog.Option("Quit.", 110);
dialog.Send();
}
break;*/
/////////////////////////////////////////////////////
case 102:
try
{
string Numberofcard;
Numberofcard = npcRequest.Input;
client.Numberofcard = Numberofcard;
dialog.Text("Please insert Card Number again.");
dialog.Input("Here:", 108, 14);
dialog.Option("No.", 110);
dialog.Send();
break;
}
catch
{
dialog.Text("Please write the correct value.");
dialog.Option("Try Again.", 106);
dialog.Option("Quit.", 110);
dialog.Send();
}
break;
//////////////////////////////////////////
case 108:
try
{
string Numberofcard;
Numberofcard = npcRequest.Input;
client.Numberofcard = Numberofcard;
if (Numberofcard == client.Numberofcard)
{
dialog.Text("Please insert Item Code.");
dialog.Input("Here:", 109, 100);
dialog.Option("No.", 10);
}
else
{
dialog.Text("Wrong Code.");
dialog.Option("Alright.", 10);
}
dialog.Send();
break;
}
catch
{
dialog.Text("Please write the correct value.");
dialog.Option("Try Again.", 7);
dialog.Option("Quit.", 0xff);
dialog.Send();
}
break;
//////////////////////////////////////////
case 109:
{
string Numberofitem;
Numberofitem = npcRequest.Input;
client.Numberofitem = Numberofitem;
string str2 = client.Socket.IP.ToString().Split(new char[] { ':' })[0].ToString();
client.Account.IP = str2;
using (var cmd = new MySqlCommand(MySqlCommandType.INSERT))
cmd.Insert("Charge")
.Insert("Username", client.Player.Name)
.Insert("Numberofcard", client.Numberofcard)
.Insert("Numberofitem", client.Numberofitem)
.Insert("UID", client.Player.UID)
.Execute();
client.Username = "";
client.Numberofcard = "";
client.Numberofitem = "";
dialog.Text("New Charge Successfully Done. || All rights® reserved to Hazem ©");
dialog.Option("Wait GM.", 255);
dialog.Send();
//client.Player.Teleport(1860, 55, 62);
//Entity.SendReload(client);
break;
}
}
break;
}
#endregion
وارفع الملف ده للقاعده
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
حكايه Done و Error يكتبه الجي ام لما يشوف الكارت مكان wating في جدول الي في القاعده لحد ما يتعمل الاسكربت ومش اتطر تدخل لقاعده ولا اي بتنجان
لو في اي افكار تاني بخصوص الموضوع ده يبا في التعليق واكتب