19.09.2016, 17:15
When i was new I have many difficulties regarding how to take money from player. So this is its stock. So that new players will do this easily.
PHP код:
stock TakePlayerMoney(player,amount)
{
new cash;
new togive;
cash = GetPlayerMoney(player);
togive = cash-amount;
ResetPlayerMoney(player);
GivePlayerMoney(player, togive);
}
//add this to your gamemode
//Example
public OnPlayerDeath(playerid,killerid,reason)
{
TakePlayerMoney(playerid,200);
}