When player choose a weapon. -
I created a dialog of weapons' lists and I don't know how do I script that when a player chooses a listed item from the list, The weapons will stay on him even if he dies untill he decided to reset them (The last option in the dialog).
PHP код:
#define DIALOG_WEAPONS 7
if (strcmp("/weapons", cmdtext, true, 10) == 0){
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "{00F7FF}рщчйн{FFFFFF}", "рщчйн чмйн{FFFFFF}\n рщчйн лбгйн{FFFFFF}\n{0066ff}Deagle - CBUG{FFFFFF}\n айфес рщчйн{FFFFFF}", "бзйшд", "йцйад");
return 1;}
if(dialogid == DIALOG_WEAPONS)
{
if(response)
{
if(listitem == 0)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 22, 10000);
GivePlayerWeapon(playerid, 26, 10000);
GivePlayerWeapon(playerid, 28, 10000);
SendClientMessage(playerid, COLOR_YELLOW, "!чйбмъ рщчйн чмйн");
}
if(listitem == 1)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 10000);
GivePlayerWeapon(playerid, 27, 10000);
GivePlayerWeapon(playerid, 29, 10000);
GivePlayerWeapon(playerid, 31, 10000);
GivePlayerWeapon(playerid, 34, 10000);
SendClientMessage(playerid, COLOR_YELLOW, "!чйбмъ рщчйн лбгйн");
}
if(listitem == 2)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 10000);
SendClientMessage(playerid, 0x0066ffff, "!C-BUGчйбмъ гйвм мчшбеъ д");
}
if(listitem == 3)
{
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "!айфсъ аъ дрщчйн щмк");
}
}
return 1;
}
This is my old mod so if there will be any question why didn't I use 'case's the answer can be found here