08.05.2011, 21:32
pawn Код:
#include <GP>
forward VerificarDinheiro(playerid);
new TimerUpdateMoney[MAX_PLAYERS];
public VerificarDinheiro(playerid)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, GP[playerid]);
return 1;
}
// No OnPlayerLogin
TimerUpdateMoney[playerid] = SetTimerEx("VerificarDinheiro", 1000, true, "i", playerid);
Код:
#if defined _GP_included #endinput #endif #define _GP_included #pragma library Pcash /* native GivePlayerMoneyEx(playerid, money) native ResetPlayerMoneyEx(playerid) native GetPlayerMoneyEx(playerid) native SetPlayerMoneyEx(playerid, money) */ new GP[MAX_PLAYERS]; stock GivePlayerMoneyEx(playerid, money) { GP[playerid] = GP[playerid] + money; return GP[playerid]; } stock ResetPlayerMoneyEx(playerid) { GP[playerid] = 0; return GP[playerid]; } stock GetPlayerMoneyEx(playerid) { return GP[playerid]; } stock SetPlayerMoneyEx(playerid, money) { GP[playerid] = GP[playerid] - GP[playerid]; GP[playerid] = GP[playerid] + money; return GP[playerid]; }