08.01.2013, 15:11
Hello,
I need help with my /weapon command syntax because it's not working. The command is in dialog form and the dialog style is input.
My code is:
Please tell me what's the problem?
I need help with my /weapon command syntax because it's not working. The command is in dialog form and the dialog style is input.
My code is:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_WEAPON)
{
if(strcmp(inputtext))
{
new weaponid;
if(weaponid > 47) return SendClientMessage(playerid, -1, "[SHOP]:Unknown weapon id!");
if(weaponid < 0) return SendClientMessage(playerid, -1, "[SHOP]:Unknown weapon id!");
new string[128], wname[24];
GetWeaponName(weaponid, wname, sizeof(wname));
format(string, sizeof(string), "[SHOP]:You have bought %s for $1000.", wname);
GivePlayerWeapon(playerid, weaponid, 500);
SendClientMessage(playerid, -1, string);
GivePlayerMoney(playerid, -1000);
}
return 1;
}
return 1;
}


