Simple functions doubles the amount.
#3

pawn Код:
stock Hook_GivePlayerMoney(playerid, amount)
{
    Account[playerid][PocketMoney] += amount;

    ResetPlayerMoney(playerid);
    return GivePlayerMoney(playerid, Account[playerid][PocketMoney]);
}

#if defined _ALS_GivePlayerMoney
    #undef GivePlayerMoney
#else
    #define _ALS_GivePlayerMoney
#endif

#define GivePlayerMoney Hook_GivePlayerMoney

stock SetPlayerMoney(playerid, amount)
{
    Account[playerid][PocketMoney] = amount;

    ResetPlayerMoney(playerid);
    return GivePlayerMoney(playerid, amount);
}
There's no need for any "Ex" functions. Put the hook in your script before it is used anywhere.

Use "SetPlayerMoney" when a player logs in and use "GivePlayerMoney" everywhere else.

P.S. There are 3 LSL CNR servers now? Seriously?

And so much CNR edits this year...
Reply


Messages In This Thread
Simple functions doubles the amount. - by CrazyChoco - 27.12.2015, 16:53
Re: Simple functions doubles the amount. - by SecretBoss - 27.12.2015, 17:03
Re: Simple functions doubles the amount. - by SickAttack - 27.12.2015, 17:06
Re: Simple functions doubles the amount. - by CrazyChoco - 27.12.2015, 18:16
Re: Simple functions doubles the amount. - by AmigaBlizzard - 27.12.2015, 23:24
Re: Simple functions doubles the amount. - by SickAttack - 28.12.2015, 00:52
Re: Simple functions doubles the amount. - by jessejanssen - 28.12.2015, 02:23
Re: Simple functions doubles the amount. - by SickAttack - 28.12.2015, 03:04
Re: Simple functions doubles the amount. - by AmigaBlizzard - 05.01.2016, 19:39

Forum Jump:


Users browsing this thread: 1 Guest(s)