Command:
PHP код:
CMD:shop(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2498.2661, -1687.1343, 13.4928))
{
ShowPlayerDialog(playerid, DIALOG_SHOP, DIALOG_STYLE_LIST, "Shop", " Armor ($5000)\nSpas-12 ($5000)\nAK47 ($5000)\nM4 ($5000)\nSniper ($5000)\nDeagle ($3000)\nShotgun ($2000)\nMP5 ($2000)", "Buy", "Close");
}
return 1;
}
Dialog:
PHP код:
else if(dialogid == DIALOG_SHOP)
{
switch(listitem)
{
case 0: //Vest/armour
{
if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money for that.");
GivePlayerCash(playerid, -5000);
SetPlayerArmour(playerid, 100);
}
case 1: //Spas-12
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money for that.");
GivePlayerCash(playerid, -5000);
GivePlayerGun(playerid, 27, 50);
}
case 2: //AK47
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money for that.");
GivePlayerCash(playerid, -5000);
GivePlayerGun(playerid, 30, 50);
}
case 3: //M4
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money for that.");
GivePlayerCash(playerid, -5000);
GivePlayerGun(playerid, 31, 50);
}
case 4: //Sniper
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money for that.");
GivePlayerCash(playerid, -5000);
GivePlayerGun(playerid, 34, 50);
}
case 5: //Deagle
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money for that.");
GivePlayerCash(playerid, -3000);
GivePlayerGun(playerid, 24, 50);
}
case 6: //Shotgun
{
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money for that.");
GivePlayerCash(playerid, -2000);
GivePlayerGun(playerid, 25, 50);
}
case 7: //MP5
{
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money for that.");
GivePlayerCash(playerid, -2000);
GivePlayerGun(playerid, 29, 50);
}
}
}
return 1;
}