08.05.2014, 14:28
Check the dialogid either with switch (recommended) or with if/else if statement. It's kind of pointless to check if the dialog is equal to DIALOG_FAM_TOKEN and theck checking again if the dialogid is 1.
All your scripts that use OnDialogResponse callback must return 0 at the end of it.
All your scripts that use OnDialogResponse callback must return 0 at the end of it.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case DIALOG_FAM_TOKEN:
{
if (response)
{
switch(listitem)
{
case 0:
{
if (FamilyInfo[playerid][FamilyTurfTokens] < 3) return SendClientMessage(playerid, COLOR_GRAD1, "You dont have 3 token to buy that!");
GivePlayerValidWeapon(playerid, 26, 999999999);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have buy sawn-off shotgun for 3 tokens!");
FamilyInfo[playerid][FamilyTurfTokens] -=3;
}
}
}
}
}
return 0;
}