ShowPlayerDialog(...);
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case YOUR_DIALOG_ID:
{
switch (listitem)
{
case 0 :
{
//GiveWeapon
ShowPlayerDialog(playerid,YOUR_DIALOG_ID,DIALOG_STYLE_LIST,"Weapons","Brass Knuckes\nAnd SO ON","Buy","Exit");
}
case 1:
{
//GiveWeapon
ShowPlayerDialog(playerid,YOUR_DIALOG_ID,DIALOG_STYLE_LIST,"Weapons","Brass Knuckes\nAnd SO ON","Buy","Exit");
}
}
}
}
return 1;
}
pawn Код:
|
Yeah its works now but 2 problems.
1.Its dont give the weapons 2.when i press "exit" or "esc" its dont exit or cancel the dialog. |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new string[400], _tmpstring[256], INI:file, filename[WEAPONSHOP], h = GetPVarInt(playerid, "LastCp"), amount = floatround(strval(inputtext)); format(filename, sizeof(filename), FILEPATH, h); if(dialogid == WEAPONSHOP && response) { switch(listitem) { case 0: SetPlayerHealth(playerid,100); case 1: SetPlayerArmour(playerid,100); case 2: GivePlayerWeapon(playerid,31,1000); case 3: GivePlayerWeapon(playerid,34,1000); case 4: GivePlayerWeapon(playerid,26,1000); case 5: GivePlayerWeapon(playerid,28,1000); case 6: GivePlayerWeapon(playerid,24,1000); return 1; }
case 0:
{
SetPlayerHealth(playerid,100);
ShowPlayerDialog(playerid,WEAPONSHOP,DIALOG_STYLE_LIST,"Shop","Add items here","OK","Exit");
}
//Do this for all
case 1: SetPlayerArmour(playerid,100);
case 2: GivePlayerWeapon(playerid,31,1000);
case 3: GivePlayerWeapon(playerid,34,1000);
case 4: GivePlayerWeapon(playerid,26,1000);
case 5: GivePlayerWeapon(playerid,28,1000);
case 6: GivePlayerWeapon(playerid,24,1000);
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[400], _tmpstring[256], INI:file, filename[WEAPONSHOP], h = GetPVarInt(playerid, "LastCp"), amount = floatround(strval(inputtext));
format(filename, sizeof(filename), FILEPATH, h);
if(dialogid == WEAPONSHOP && response)
{
switch(listitem)
{
case 0: SetPlayerHealth(playerid,100);
case 1: SetPlayerArmour(playerid,100);
case 2: GivePlayerWeapon(playerid,31,1000);
case 3: GivePlayerWeapon(playerid,34,1000);
case 4: GivePlayerWeapon(playerid,26,1000);
case 5: GivePlayerWeapon(playerid,28,1000);
case 6: GivePlayerWeapon(playerid,24,1000);
}
ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "Weapon Shop", "Health\nArmour\netc...", "Buy", "Cancel");
return 1;
}
pawn Код:
|