if(dialogid == DIALOG_FAM_TOKEN) { if(response) { switch(dialogid) { case 1: { switch(listitem) { case 0: { if(FamilyInfo[playerid][FamilyTurfTokens] >= 3) { GivePlayerValidWeapon(playerid, 26, 999999999); SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have buy sawn-off shotgun for 3 tokens!"); FamilyInfo[playerid][FamilyTurfTokens] -=3; } else return SendClientMessage(playerid, COLOR_GRAD1, "You dont have 3 token to buy that!"); } } } } } }
CMD:ftokenshop(playerid, params[]) { //if(PlayerInfo[playerid][pGang] > 0) //{ if(IsPlayerInRangeOfPoint(playerid, 2.0 ,-2235.1304, 130.1577, 1035.4141)) { ShowPlayerDialogEx(playerid, DIALOG_FAM_TOKEN, DIALOG_STYLE_LIST, "Philippines-Roleplay Family Token Shop", "Sawn-off shotgun(3 Token)\n Uzi(2 Token)\nSpas(4 Token)\n200 Armor(8 Token)\nRPG(Special 200 Token", "Select", "Cancel"); } else return SendClientMessage(playerid, COLOR_WHITE, "Your not range in Family Token Shop!"); return 1; //} //return SendClientMessage(playerid, COLOR_REALRED, "Your not in any gang!!!!!!!!!!"); }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 0;
}
Make sure that public OnDialogResponse returns 0.
pawn Код:
|
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_FAM_TOKEN)
{
if(response)
{
switch(dialogid)
{
case 1:
{
switch(listitem)
{
case 0:
{
if(FamilyInfo[playerid][FamilyTurfTokens] >= 3)
{
GivePlayerValidWeapon(playerid, 26, 999999999);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have buy sawn-off shotgun for 3 tokens!");
FamilyInfo[playerid][FamilyTurfTokens] -=3;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You dont have 3 token to buy that!");
}
}
}
}
}
}
}
return 0;
}
CMD:ftokenshop(playerid, params[])
{
//if(PlayerInfo[playerid][pGang] > 0)
//{
if(IsPlayerInRangeOfPoint(playerid, 2.0 ,-2235.1304, 130.1577, 1035.4141))
{
ShowPlayerDialogEx(playerid, DIALOG_FAM_TOKEN, DIALOG_STYLE_LIST, "Philippines-Roleplay Family Token Shop", "Sawn-off shotgun(3 Token)\n Uzi(2 Token)\nSpas(4 Token)\n200 Armor(8 Token)\nRPG(Special 200 Token", "Select", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Your not range in Family Token Shop!");
}
return 1;
//}
//return SendClientMessage(playerid, COLOR_REALRED, "Your not in any gang!!!!!!!!!!");
}
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;
}
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. pawn Код:
|