sfcnr/gamemodes/irresistible/anticheat/money.pwn

45 lines
881 B
Plaintext

/*
* Irresistible Gaming (c) 2018
* Developed by Lorenc Pekaj
* Module: anticheat\money.pwn
* Purpose: server-sided money
*/
/* ** Error checking ** */
#if !defined __ac__money
#define __ac__money
#else
#endinput
#endif
/* ** Variables ** */
static stock
p_Cash [ MAX_PLAYERS ];
/* ** Functions ** */
stock GivePlayerCash( playerid, money )
{
p_Cash[ playerid ] += money;
ResetPlayerMoney( playerid );
GivePlayerMoney( playerid, p_Cash[ playerid ] );
}
stock SetPlayerCash( playerid, money )
{
p_Cash[ playerid ] = money;
ResetPlayerMoney( playerid );
GivePlayerMoney( playerid, p_Cash[ playerid ] );
}
stock ResetPlayerCash( playerid )
{
p_Cash[ playerid ] = 0;
ResetPlayerMoney( playerid );
GivePlayerMoney( playerid, p_Cash[ playerid ] );
}
stock GetPlayerCash( playerid )
{
return p_Cash[ playerid ];
}