21.07.2012, 17:16
Hello guys can you help me make BACK or Return to list..
Код:
Example. If Player use /w and click Pistols, but he think its better if he use Assault so he will click BACK. My script only have cancel.
pawn Код:
if (strcmp("/w", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Weapon Lists", "Melee\nPistols\nSub-Machine Guns\nRifle's\nAssault\nShotgun's\nMisc", "Select", "Cancel");
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGID)
{
if(response)
{
if(listitem == 0) // Meele
{
ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Select a Weapon", "Knuckle Dusters\nGolf Club\nNite Stick\nBat\nShovel\nPool Cue\nKatana\nDildo\nSpray Can\nCane", "Select", "Cancel");
}
if(listitem == 1) // Pistols
{
ShowPlayerDialog(playerid, DIALOGID+2, DIALOG_STYLE_LIST, "Select a Weapon", "9mm\nSilenced 9mm\nDesert Eagle", "Select", "Cancel");
}
if(listitem == 2) // Sub-Machine Guns
{
ShowPlayerDialog(playerid, DIALOGID+3, DIALOG_STYLE_LIST, "Select a Weapon", "Uzi\nSMG\nTec9", "Select", "Cancel");
}
if(listitem == 3) // Rifles
{
ShowPlayerDialog(playerid, DIALOGID+4, DIALOG_STYLE_LIST, "Select a Weapon", "Country Rifle\nSniper Rifle", "Select", "Cancel");
}
if(listitem == 4) // Assault
{
ShowPlayerDialog(playerid, DIALOGID+5, DIALOG_STYLE_LIST, "Select a Weapon", "AK-47\nM4", "Select", "Cancel");
}
if(listitem == 5) // Shotguns
{
ShowPlayerDialog(playerid, DIALOGID+6, DIALOG_STYLE_LIST, "Select a Weapon", "Standard Shotgun\nSawnoff Shotgun\nCombat Shotgun", "Select", "Cancel");
}
if(listitem == 6) // Misc
{
ShowPlayerDialog(playerid, DIALOGID+7, DIALOG_STYLE_LIST, "Select a Weapon", "Fire Extinguisher\nParachute\nNightvision Goggles\nFlowers", "Select", "Cancel");
}
}
return 1;
}
if(dialogid == DIALOGID+1) // Meele
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 1, 1);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 2, 1);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 3, 1);
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 5, 1);
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 6, 1);
}
if(listitem == 5)
{
GivePlayerWeapon(playerid, 7, 1);
}
if(listitem == 6)
{
GivePlayerWeapon(playerid, 8, 1);
}
if(listitem == 7)
{
GivePlayerWeapon(playerid, 10, 1);
}
if(listitem == 8)
{
GivePlayerWeapon(playerid, 41, 15000);
}
if(listitem == 9)
{
GivePlayerWeapon(playerid, 15, 1);
}
}
return 1;
}
if(dialogid == DIALOGID+2) // Pistols
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 22, 15000);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 23, 15000);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 24, 15000);
}
}
return 1;
}
if(dialogid == DIALOGID+3) // Sub's
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 28, 15000);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 29, 15000);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 32, 15000);
}
}
return 1;
}
if(dialogid == DIALOGID+4) // Rifle's
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 33, 15000);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 34, 15000);
}
}
return 1;
}
if(dialogid == DIALOGID+5) // Assault
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 30, 15000);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 31, 15000);
}
}
return 1;
}
if(dialogid == DIALOGID+6) // Shotguns
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 25, 15000);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 26, 15000);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 27, 15000);
}
}
return 1;
}
if(dialogid == DIALOGID+7) // Misc Fire Extinguisher\nSatchel Charge\nParachute\nNightvision Goggles\nFlowers
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 42, 15000);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 46, 1);
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 44, 1);
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 14, 1);
}
}
return 1;
}