21.05.2014, 13:25
PHP код:
case 0:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerWeapon(playerid, 4, 1);
GivePlayerMoney(playerid, -2500);
}else{
SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
}
}
case 1:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerWeapon(playerid, 5, 1);
GivePlayerMoney(playerid, -2500);
}
case 2:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerWeapon(playerid, 22, 5000);
GivePlayerMoney(playerid, -2500);
}else{
SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
}
}
case 3:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerWeapon(playerid, 23, 5000);
GivePlayerMoney(playerid, -2500);
}else{
SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
}
}
case 4:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerWeapon(playerid, 24, 5000);
GivePlayerMoney(playerid, -2500);
}else{
SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
}
}
case 5:
{
if(GetPlayerMoney(playerid) >= 2500)
{
GivePlayerWeapon(playerid, 25, 5000);
GivePlayerMoney(playerid, -2500);
}else{
SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
}
}
PHP код:
if(GetPlayerMoney(playerid) < 2500)
PHP код:
if(GetPlayerMoney(playerid) >= 2500)
The code checks if you have less money than 2500 and if you have given your weapon, and if you have more you give the message that you do not have much money