31.10.2011, 10:44
Hey forum, i created a weapon shop with Dialogs and zcmd for my DM script , it works fine but when i choose a colt , tec , uzi i got in both hands a uzi not in one hand how can i change that? and how can i make when a player dont got enough money then he cant buy a gun ?
Script:
Script:
pawn Код:
#define ListDialog 1
#define WeaponDialog 1
#define ShopDialog 1
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == ListDialog)
{
if(response == 0)
{
return 1;
}
if(response == 1)
{
//
}
if(listitem == 0)
{
SendClientMessage(playerid,0xC92020FF,"You Choosed a Colt 45, have Fun with it!");
GivePlayerWeapon(playerid, 22, 500);
return 1;
}
if(listitem == 1)
{
SendClientMessage(playerid,0xC92020FF,"You Choosed an Israel Uzi, have Fun with it!");
GivePlayerWeapon(playerid, 28, 500);
return 1;
}
if(listitem == 2)
{
SendClientMessage(playerid,0xC92020FF,"You Choosed an Tec 9, have Fun with it!");
GivePlayerWeapon(playerid, 32, 500);
return 1;
}
if(listitem == 3)
{
SendClientMessage(playerid,0xC92020FF,"You Choosed a Shotgun, have Fun with it!");
GivePlayerWeapon(playerid, 25, 500);
return 1;
}
}
pawn Код:
CMD:shop(playerid, params[])
{
SendClientMessage(playerid, 0xC92020FF, "You have opened the Shop!");
ShowPlayerDialog(playerid, ListDialog, DIALOG_STYLE_LIST, "Weapon Shop", "Colt45\nIsrael Uzi\nTec9\nShotgun", "OK", "CANCEL");
}