14.09.2011, 13:04
pawn Код:
if(dialogid == 3)
{
if(response == 0) return SendClientMessage(playerid, COLOR_YELLOW, "You closed the '/buy' menu.");
switch(listitem) {
case 0:
{
if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!"); // now itll check his money the first thing when he clicks on the first list item
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a Desert Eagle for $6000.");
GivePlayerWeapon(playerid, 24, 40);
GivePlayerMoney(playerid, -6000);
}
case 1:
{
if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!"); // etc etc
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a Combat Shotgun for $14000.");
GivePlayerWeapon(playerid, 27, 107);
GivePlayerMoney(playerid, -14000);
}
case 2:
{
if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!");
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a MP5 for $10000.");
GivePlayerWeapon(playerid, 29, 230);
GivePlayerMoney(playerid, -10000);
}
case 3:
{
if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!");
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a AK-47 for $14000.");
GivePlayerWeapon(playerid, 30, 460);
GivePlayerMoney(playerid, -14000);
}
case 4:
{
if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!");
SendClientMessage(playerid, COLOR_YELLOW, "You have bought a M4 for $16000.");
GivePlayerWeapon(playerid, 31, 460);
GivePlayerMoney(playerid, -16000);
}
}
}