30.11.2014, 09:39
I have some server-side money, which works perfectly with the mechanics of the server:
I use GivePlayerMoney and SetPlayerMoney for it to work clientside aswell, but i need to know how to do this at OnPlayerSpawn? So that the money becomes visible when he spawns?
pawn Код:
stock GiveZaiatMoney(playerid, amount)
{
new string[128];
if(amount < 0) format(string, sizeof(string), "~r~-$%d", amount*-1);
else if(amount > 0) format(string, sizeof(string), "~g~+$%d", amount);
GameTextForPlayer(playerid, string, 3000, 1);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pMoney] = PlayerInfo[playerid][pMoney]+amount;
GivePlayerMoney(playerid,amount);
return 1;
}
stock SetZaiatMoney(playerid, amount)
{
PlayerInfo[playerid][pMoney] = amount;
SetPlayerMoney(playerid,amount);
return 1;
}