03.10.2013, 16:09
HI How to make Weapon Spawner DIALOG .?
HElP me For my /VIPLocker
HElP me For my /VIPLocker
#define DIALOG_WEAPONS 111 //111 in this case. You have to define the id here.
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "AK-47\nM4\nSniper Rifle", "Select", "Cancel");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)
{
case DIALOG_WEAPONS:// Our dialog! which will be called when dialog id is 111
{
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
GivePlayerWeapon(playerid, 30, 9999999); // Give playerid a AK 47 with 9999999 ammo
}
case 1: // The second item listed
{
GivePlayerWeapon(playerid, 31, 9999999); // Give playerid a M4 Rifle with 9999999 ammo
}
case 2: // The third item listed
{
GivePlayerWeapon(playerid, 34, 9999999); // Give playerid a Sniper Refile with 9999999 ammo
}
}
}
}
}
return 1;
}