Guest User

Untitled

a guest
Jan 4th, 2013
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.04 KB | None | 0 0
  1. /* OnPlayerReceiveMoney callback,made by Plovix(Dino Hodzic),Year: 2012.
  2. You're not allowed to re-release this or claim as yours and edit or remove credits!
  3. My forum profile: http://forum.sa-mp.com/member.php?u=147604
  4. If you find any bug/s,post it on my forum profile or on a topic */
  5.  
  6. #include <a_samp>
  7. #include <YSI\y_hooks>
  8. #if !defined _samp_included
  9.         #error "Plovix error: |Please include a_samp.inc!|"
  10. #endif
  11.  
  12. //Var
  13. new pCurMoneyPx[MAX_PLAYERS];
  14.  
  15. //Callbacks
  16. hook OnPlayerUpdate(playerid)
  17. {
  18.     if(GetPlayerMoney(playerid) > pCurMoneyPx[playerid])
  19.     {
  20.     new pMoneyDifference;
  21.     pMoneyDifference = GetPlayerMoney(playerid) - pCurMoneyPx[playerid];
  22.     pCurMoneyPx[playerid] = GetPlayerMoney(playerid);
  23.     CallLocalFunction("OnPlayerReceiveMoney","id",playerid,pMoneyDifference);
  24.     pMoneyDifference = 0;
  25.     }
  26.     return 1;
  27. }
  28.  
  29. hook OnPlayerConnect(playerid)
  30. {
  31.     pCurMoneyPx[playerid] = 0;
  32. }
  33.  
  34. hook OnPlayerDisconnect(playerid, reason)
  35. {
  36.     pCurMoneyPx[playerid] = 0;
  37. }
  38.  
  39. //Forward
  40. forward OnPlayerReceiveMoney(playerid, amount);
Advertisement
Add Comment
Please, Sign In to add comment