if(dialogid == DIALOG_TOKEN) { if(response) { if(listitem == 0) { ShowPlayerDialogEx(playerid, DIALOG_T_WEAPON, DIALOG_STYLE_LIST, "Weapon token shop", "Sawn-Off (3 Token)\n Spas(5 Token)\n Uzi(2 Token)\n Rocket Launcher (200 token)", "Buy", "Cancel"); return 1; } else if(listitem == 1) { ShowPlayerDialogEx(playerid, DIALOG_T_LEVEL, DIALOG_STYLE_LIST, "Level Shop", "Level 10 (5 Token)\n Level 30 (10 Token)\n Level 50 (30 Token)\n Level 100 (50 Token)\n Level 500 (300 Token)", "Buy", "Cancel"); return 1; } else if(listitem == 2) { SendClientMessage(playerid, COLOR_REALRED, "Upgrade points is currently under maintenance! Thank you for understand!"); return 1; } else if(listitem == 3) { ShowPlayerDialogEx(playerid, DIALOG_T_MONEYC, DIALOG_STYLE_LIST, "Token to Money Changer", "$50,000 (8 Token)\n $100,000 (11 Token)\n $1,000000 (20 Token)", "Buy", "Cancel"); return 1; } else if(listitem == 4) { ShowPlayerDialogEx(playerid, DIALOG_T_HA, DIALOG_STYLE_LIST, "Health & Armor shop", "+ 200 Armor (15 Token)\n+ 200 Health (13 Token)", "Select", "Cancel"); return 1; } } return 1; }
if(GetPVarInt(playerid, "dialog") != dialogid ) { // Confirm the dialogid matches what we have in the PVar format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly trying to spoof a dialog ID (%d).", GetPlayerNameEx(playerid), playerid, dialogid); ABroadCast(COLOR_YELLOW, string, 2); format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID.", GetPlayerNameEx(playerid)); AddAutomatedFlag(playerid, string); format(string, sizeof(string), "%s has possibly tried to spoof a dialog ID (%d, %d).", GetPlayerNameEx(playerid), dialogid, response); Log("logs/crash.log", string); return 1; }
if(dialogid == DIALOG_TOKEN)
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialogEx(playerid, DIALOG_T_WEAPON, DIALOG_STYLE_LIST, "Weapon token shop", "Sawn-Off (3 Token)\n Spas(5 Token)\n Uzi(2 Token)\n Rocket Launcher (200 token)", "Buy", "Cancel");
return 1;
}
case 1:
{
ShowPlayerDialogEx(playerid, DIALOG_T_LEVEL, DIALOG_STYLE_LIST, "Level Shop", "Level 10 (5 Token)\n Level 30 (10 Token)\n Level 50 (30 Token)\n Level 100 (50 Token)\n Level 500 (300 Token)", "Buy", "Cancel");
return 1;
}
case 2:
{
SendClientMessage(playerid, COLOR_REALRED, "Upgrade points is currently under maintenance! Thank you for understand!");
return 1;
}
case 3:
{
ShowPlayerDialogEx(playerid, DIALOG_T_MONEYC, DIALOG_STYLE_LIST, "Token to Money Changer", "$50,000 (8 Token)\n $100,000 (11 Token)\n $1,000000 (20 Token)", "Buy", "Cancel");
return 1;
}
case 4:
{
ShowPlayerDialogEx(playerid, DIALOG_T_HA, DIALOG_STYLE_LIST, "Health & Armor shop", "+ 200 Armor (15 Token)\n+ 200 Health (13 Token)", "Select", "Cancel");
return 1;
}
}
}
return 1;
}
I think you should make a " switch() " like that :
PHP код:
And why you don't make a simply " ShowPlayerDialog " rather than " ShowPlayerDialogEx " ? Finally, can you show me you define for the " DIALOG_T_XXXX " please ? |
#define DIALOG_TOKEN 1970 #define DIALOG_T_WEAPON 1985 #define DIALOG_T_UPGRADE 20012 #define DIALOG_T_LEVEL 102014 #define DIALOG_T_MONEYC 2102001 #define DIALOG_T_HA 37634
stop bumping! you'll need to wait 24h before DP.
ShowPlayerDialogEx? Can you send us code for this function? |
// Anti Dialog ID spoofing #define ShowPlayerDialogEx(%0, %1, %2, %3, %4, %5, %6) ShowPlayerDialog(%0, %1, %2, %3, %4, %5, %6) \ SetPVarInt(%0, "dialog", %1)*/ stock ShowPlayerDialogEx(playerid, dialogid, style, caption[], info[], button1[], button2[]) { SetPVarInt(playerid, "dialog", dialogid); ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2); return 1; }
if(dialogid == DIALOG_TOKEN)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, DIALOG_T_WEAPON, DIALOG_STYLE_LIST, "Weapon token shop", "Sawn-Off (3 Token)\n Spas(5 Token)\n Uzi(2 Token)\n Rocket Launcher (200 token)", "Buy", "Cancel");
return 1;
}
else if(listitem == 1)
{
ShowPlayerDialog(playerid, DIALOG_T_LEVEL, DIALOG_STYLE_LIST, "Level Shop", "Level 10 (5 Token)\n Level 30 (10 Token)\n Level 50 (30 Token)\n Level 100 (50 Token)\n Level 500 (300 Token)", "Buy", "Cancel");
return 1;
}
else if(listitem == 2)
{
SendClientMessage(playerid, COLOR_REALRED, "Upgrade points is currently under maintenance! Thank you for understand!");
return 1;
}
else if(listitem == 3)
{
ShowPlayerDialog(playerid, DIALOG_T_MONEYC, DIALOG_STYLE_LIST, "Token to Money Changer", "$50,000 (8 Token)\n $100,000 (11 Token)\n $1,000000 (20 Token)", "Buy", "Cancel");
return 1;
}
else if(listitem == 4)
{
ShowPlayerDialog(playerid, DIALOG_T_HA, DIALOG_STYLE_LIST, "Health & Armor shop", "+ 200 Armor (15 Token)\n+ 200 Health (13 Token)", "Select", "Cancel");
return 1;
}
}
return 1;
}
pawn Код:
|