21.01.2013, 18:01
I want that the players begin with 5000 $ and can give money to others
public OnPlayerSpawn(playerid)
{
SetPlayerMoney(playerid, GetPlayerMoney(playerid) + 5000);
return 1;
}
GivePlayerMoney(playerid,5000); |
COMMAND:pay(playerid,params[]) { new id, betrag; if(sscanf(params,"dd",id,betrag)) return NoSuccess(playerid,"Usage /pay id amount"); if(!IsPlayerConnected(id)) return NoSuccess(playerid,"player is not connected!"); if(betrag < 0) return NoSuccess(playerid,"Amount cannot be under 0!"); if(GetPlayerMoney(playerid) < betrag) return NoSuccess(playerid,"dont have so much money!"); GivePlayerMoney(playerid,-betrag); GivePlayerMoney(id,betrag); return 1; }
GivePlayerMoney(playerid,5000);