Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================//
- //* OnPlayerMoneyChange - OPMC
- //* Version: 1.0
- //============================================================//
- //* Created by:
- //* Biesmen
- //============================================================//
- //* Using the ALS Hooking.
- //============================================================//
- #include <a_samp>
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 500 // Change 500 to your server's playerslots.
- new OPMCMoney[MAX_PLAYERS];
- static
- bool:PlayerUP,
- bool:PlayerSP;
- forward OnPlayerMoneyChange(playerid, amount);
- public OnPlayerSpawn(playerid)
- {
- OPMCMoney[playerid] = GetPlayerMoney(playerid);
- return (PlayerSP)?CallLocalFunction("Inc_OnPlayerSpawn","i", playerid):1;
- }
- #if defined _ALS_OnPlayerSpawn
- #undef OnPlayerSpawn
- #else
- #define _ALS_OnPlayerSpawn
- #endif
- #define OnPlayerSpawn Inc_OnPlayerSpawn
- forward Inc_OnPlayerSpawn(playerid);
- public OnPlayerUpdate(playerid)
- {
- new ZmoneyZ[MAX_PLAYERS];
- if(GetPlayerMoney(playerid) != OPMCMoney[playerid])
- {
- ZmoneyZ[playerid] = GetPlayerMoney(playerid)-OPMCMoney[playerid];
- CallLocalFunction("OnPlayerMoneyChange", "ii", playerid, ZmoneyZ[playerid]);
- OPMCMoney[playerid] = GetPlayerMoney(playerid);
- }
- return (PlayerUP)?CallLocalFunction("Inc_OnPlayerUpdate","i", playerid):1;
- }
- #if defined _ALS_OnPlayerUpdate
- #undef OnPlayerUpdate
- #else
- #define _ALS_OnPlayerUpdate
- #endif
- #define OnPlayerUpdate Inc_OnPlayerUpdate
- forward Inc_OnPlayerUpdate(playerid);
- public OnGameModeInit()
- {
- PlayerUP = (funcidx("Inc_OnPlayerUpdate") != -1);
- PlayerSP = (funcidx("Inc_OnPlayerSpawn") != -1);
- return (funcidx("Inc_OnGameModeInit") != -1)?CallLocalFunction("Inc_OnGameModeInit",""):1;
- }
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit Inc_OnGameModeInit
- forward Inc_OnGameModeInit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement