Advertisement
Guest User

Untitled

a guest
Nov 11th, 2012
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.80 KB | None | 0 0
  1. /* OnPlayerWeaponStateChange 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. #include <a_samp>
  6. #if !defined _samp_included
  7.     #error "Plovix error: |Please include a_samp.inc!|"
  8. #endif
  9. new pWeaponStatePlovixx[256];
  10. public OnPlayerConnect(playerid)
  11. {
  12. pWeaponStatePlovixx[playerid] = 255;
  13. CallLocalFunction("ExampleOPC", "i", playerid);
  14. return true;
  15. }
  16. #if defined _ALS_OnPlayerConnect
  17.    #undef OnPlayerConnect
  18. #else
  19. #define _ALS_OnPlayerConnect
  20. #endif
  21. #define OnPlayerConnect ExampleOPC
  22. public OnPlayerDisconnect(playerid)
  23. {
  24. pWeaponStatePlovixx[playerid] = 255;
  25. CallLocalFunction("ExampleOPD", "i", playerid);
  26. return true;
  27. }
  28. #if defined _ALS_OnPlayerDisconnect
  29.    #undef OnPlayerDisconnect
  30. #else
  31. #define _ALS_OnPlayerDisconnect
  32. #endif
  33. #define OnPlayerDisconnect ExampleOPD
  34. public OnPlayerUpdate(playerid)
  35. {
  36. new ab[256];
  37. ab[playerid] = GetPlayerWeaponState(playerid);
  38. new pWeaponStatePlovixxx = strval(ab[playerid]);
  39. if(pWeaponStatePlovixxx != pWeaponStatePlovixx[playerid])
  40. CallLocalFunction("OnPlayerWeaponStateChange", "idd", playerid, pWeaponStatePlovixx[playerid], pWeaponStatePlovixxx);
  41. pWeaponStatePlovixx[playerid] = pWeaponStatePlovixxx;
  42. CallLocalFunction("ExampleOPU", "i", playerid);
  43. return true;
  44. }
  45. #if defined _ALS_OnPlayerUpdate
  46.    #undef OnPlayerUpdate
  47. #else
  48. #define _ALS_OnPlayerUpdate
  49. #endif
  50. #define OnPlayerUpdate ExampleOPU
  51. //native OnPlayerWeaponStateChange(playerid, oldstate, newstate);
  52. forward ExampleOPC(playerid);
  53. forward ExampleOPD(playerid, reason);
  54. forward ExampleOPU(playerid);
  55. forward OnPlayerWeaponStateChange(playerid, oldstate, newstate);
  56. //The end...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement