18.08.2013, 14:54
The only thing you need to do is to use PVar and only PVar if you want to use it for all scripts
Create your own include and call it ssmoney.inc (or something like that)
Using CallRemoteFunction is more complicated because you need to add update callbacks and I doubt that it would be faster
Create your own include and call it ssmoney.inc (or something like that)
pawn Код:
#include <a_samp>
stock static
SSM_PVar[] = "SSM_Money"
;
stock SSM_SetPlayerMoney(playerid, money) {
return SetPVarInt(playerid, SSM_PVar, money);
}
stock SSM_GivePlayerMoney(playerid, money) {
return SetPVarInt(playerid, SSM_PVar, GetPVarInt(playerid, SSM_PVar) + money);
}
stock SSM_GetPlayerMoney(playerid) {
return GetPVarInt(playerid, SSM_PVar);
}
#define SetPlayerMoney( SSM_SetPlayerMoney(
#define GivePlayerMoney( SSM_GivePlayerMoney(
#define GetPlayerMoney( SSM_GetPlayerMoney(
#define ResetPlayerMoney( SSM_SetPlayerMoney(.money=0,.playerid=