PHP код:
if(dialogid == 3)
{
if(response == 0) return SendClientMessage(playerid, COLOR_YELLOW, "You closed the '/buy' menu.");
switch(listitem)
{
case 0:
{
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a Desert Eagle for $6000.");
GivePlayerWeapon(playerid, 24, 40);
GivePlayerMoney(playerid, -6000);
if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, -1,"You don't have that much");
}
case 1:
{
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a Combat Shotgun for $14000.");
GivePlayerWeapon(playerid, 27, 107);
GivePlayerMoney(playerid, -14000);
if(GetPlayerMoney(playerid) < 14000) return SendClientMessage(playerid, -1,"You don't have that much");
}
case 2:
{
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a MP5 for $10000.");
GivePlayerWeapon(playerid, 29, 230);
GivePlayerMoney(playerid, -10000);
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1,"You don't have that much");
}
case 3:
{
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a AK-47 for $14000.");
GivePlayerWeapon(playerid, 30, 460);
GivePlayerMoney(playerid, -14000);
if(GetPlayerMoney(playerid) < 14000) return SendClientMessage(playerid, -1,"You don't have that much");
}
case 4:
{
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a M4 for $16000.");
GivePlayerWeapon(playerid, 31, 460);
GivePlayerMoney(playerid, -16000);
if(GetPlayerMoney(playerid) < 16000) return SendClientMessage(playerid, -1,"You don't have that much");
}
}
}