Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* OnPlayerReceiveMoney callback,made by Plovix(Dino Hodzic),Year: 2012.
- You're not allowed to re-release this or claim as yours and edit or remove credits!
- My forum profile: http://forum.sa-mp.com/member.php?u=147604
- If you find any bug/s,post it on my forum profile or on a topic */
- #include <a_samp>
- #include <YSI\y_hooks>
- #if !defined _samp_included
- #error "Plovix error: |Please include a_samp.inc!|"
- #endif
- //Var
- new pCurMoneyPx[MAX_PLAYERS];
- //Callbacks
- hook OnPlayerUpdate(playerid)
- {
- if(GetPlayerMoney(playerid) > pCurMoneyPx[playerid])
- {
- new pMoneyDifference;
- pMoneyDifference = GetPlayerMoney(playerid) - pCurMoneyPx[playerid];
- pCurMoneyPx[playerid] = GetPlayerMoney(playerid);
- CallLocalFunction("OnPlayerReceiveMoney","id",playerid,pMoneyDifference);
- pMoneyDifference = 0;
- }
- return 1;
- }
- hook OnPlayerConnect(playerid)
- {
- pCurMoneyPx[playerid] = 0;
- }
- hook OnPlayerDisconnect(playerid, reason)
- {
- pCurMoneyPx[playerid] = 0;
- }
- //Forward
- forward OnPlayerReceiveMoney(playerid, amount);
Advertisement
Add Comment
Please, Sign In to add comment