Changing money with a FS using server sided money
#8

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)
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=
Using CallRemoteFunction is more complicated because you need to add update callbacks and I doubt that it would be faster
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)