23.06.2016, 03:58
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == FIRSTMENU)
{
if(response)
{
if(listitem == 0) // Weapons
{
ShowPlayerDialog(playerid,FIRSTMENU+2,DIALOG_STYLE_LIST,
"Regular Players Lounge",
"MP5\nCombat Shotgun\nDesert Eagle\nM4\nAK-47\nBack",
"Select", "Exit");
}
}
}
if(dialogid == FIRSTMENU+2) // Weapons
{
if(response)
{
if(listitem == 0) // MP5
{
new ammo = GetPlayerAmmo(playerid);
if(ammo >=600)
{
SendClientMessage(playerid, COLOR_GREY,
"Sorry you have all the free ammo we can give you for now");
}
if(GetPlayerMoney(playerid) < 15000)
{
SendClientMessage(playerid, COLOR_GREY,"* You cannot afford this!");
}
else
GivePlayerMoney(playerid, -15000);
GivePlayerWeapon(playerid, 29, 200);
}
if(listitem == 1) // Chainsaw
{
new ammo = GetPlayerAmmo(playerid);
if(ammo >400)
{
SendClientMessage(playerid, COLOR_GREY,
"Sorry you have all the free ammo we can give you for now");
}
if(GetPlayerMoney(playerid) < 8000)
{
SendClientMessage(playerid, COLOR_GREY,"* You cannot afford this!");
}
else
GivePlayerWeapon(playerid,25 ,25);
GivePlayerMoney(playerid, -8000);
}
}
}
return 1;
}