01.06.2015, 17:00
PHP код:
new Money[MAX_PLAYERS];
public OnPlayerUpdate(playerid) // OU TIMER
{
if(Money[playerid] != GetPlayerMoney(playerid))
{
SetPlayerMoney(playerid,Money[playerid]);
}
return true;
}
public OnPlayerConnect(playerid)
{
ResetPlayerMoney(playerid);
return true;
}
stock _GivePlayerMoney(playerid, valor)
{
Money[playerid] += valor;
GivePlayerMoney(playerid, valor);
return true;
}
stock _ResetPlayerMoney(playerid)
{
Money[playerid] = 0;
ResetPlayerMoney(playerid);
return true;
}
stock SetPlayerMoney(playerid,valor)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, valor);
return true;
}
#if defined _ALS_GivePlayerMoney
#undef GivePlayerMoney
#else
#define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney _GivePlayerMoney
#if defined _ALS_ResetPlayerMoney
#undef ResetPlayerMoney
#else
#define _ALS_ResetPlayerMoney
#endif
#define ResetPlayerMoney _ResetPlayerMoney