06.06.2010, 19:20
I searched but I didn`t found anything. I`m trying to make a List and this is what I made:
I have no errors, but when I type /shop ingame it opens the list. I choose Armour or Guns and it fills my Health only. I want to make everything work. Help me!
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/shop", true) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Shop Menu", "Health \nArmour \nGuns", "Select", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
new message[256+1];
if(listitem == 0)
{
format(message, 256, "You successfuly bought health for $500!", 0);
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -500);
return 1;
}
if(listitem == 1)
{
format(message, 256, "You successfuly bought armour for $1000!", 1);
SetPlayerArmour(playerid, 100);
GivePlayerMoney(playerid, -1000);
return 1;
}
if(listitem == 2)
{
format(message, 256, "You successfuly bought three guns for $2500!", 2);
GivePlayerWeapon(playerid, 23, 1000);
GivePlayerWeapon(playerid, 29, 1000);
GivePlayerWeapon(playerid, 31, 1000);
GivePlayerWeapon(playerid, 34, 1000);
GivePlayerMoney(playerid, -2500);
return 1;
}
}
}
return 1;
}