06.06.2009, 11:03
Hi, so, if a man anxious to buy, and if it is not enough money can not buy.
if(GetPlayerCash(playerid) =< /*Whatever the item costs*/)
{
//Player cant afford
}
else
{
//Player can afford
}
new playermoney = GetPlayerMoney(playerid); // now you can use it where you want in your script,you don`t must always write GetPlayerMoney blah blah
if(playermoney =< /* price you want */)
{
//effect (Player can`t afford)
}
else
{
//effect (Player can afford)
}
Originally Posted by °Luka°
It is GetPlayerMoney,not GetPlayerCash,so here it is if you want to use to more things in your script
pawn Код:
|
if(GetPlayerMoney(playerid) >= PRICE)
{
// put your code (can afford)
}
else
{
// put your code (can't afford)
}
Originally Posted by Don Correlli
Quote:
pawn Код:
|
case 0: { new playermoney = GetPlayerMoney(playerid); // now you can use it where you want in your script,you don`t must always write GetPlayerMoney blah blah if(playermoney =< GivePlayerWeapon(playerid,25,1000); { GivePlayerWeapon(playerid,25,1000); } else { SendClientMessage(playerid,COLOR_LIME,"You don't money"); } }
Originally Posted by °Luka°
You make same code lol! But you are using first if playermoney is same or higher than a player cash
|