Advertisement
Lordz

lreps.inc

Nov 11th, 2012
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.25 KB | None | 0 0
  1. /*[Include]L-Reputation System by Lordz™.
  2. You are not allowed to re-release this or claim as yours.
  3. If you find any bugs or mistakes, post it on L-Reputation System topic.*/
  4.  
  5.  
  6. #define author Lordz
  7. #if defined Lreps_included
  8.    #endinput
  9. #endif
  10. #define Lreps_included
  11.  
  12. #if !defined author
  13.   #error "Please define author. #define author Lordz"
  14. #endif
  15.  
  16. #include <a_samp>
  17.  
  18. enum pRep
  19. {
  20.  Reps,
  21. }
  22. new RepInfo[MAX_PLAYERS][pRep];
  23.  
  24. stock SetPlayerReputations(playerid, amount)
  25. {
  26.   CallLocalFunction("OnPlayerRepChange", "idd", playerid, RepInfo[playerid][Reps], RepInfo[playerid][Reps] = amount);
  27.   RepInfo[playerid][Reps] = 0;
  28.   RepInfo[playerid][Reps] = amount;
  29.   return 1;
  30. }
  31.  
  32. stock ResetPlayerReputations(playerid)
  33. {
  34.   CallLocalFunction("OnPlayerRepChange", "idd", playerid, RepInfo[playerid][Reps], RepInfo[playerid][Reps] = 0);
  35.   RepInfo[playerid][Reps] = 0;
  36.   return 1;
  37. }
  38.  
  39. stock ResetPlayerReputationsEx(playerid, reason[])
  40. {
  41.   CallLocalFunction("OnPlayerRepChange", "idd", playerid, RepInfo[playerid][Reps], RepInfo[playerid][Reps] = 0);
  42.   new str[128];
  43.   RepInfo[playerid][Reps] = 0;
  44.   format(str, sizeof(str), "Your reputations has been automatically reset. Reason:%s", reason);
  45.   SendClientMessage(playerid, -1, str);
  46.   return 1;
  47. }
  48.  
  49. stock GivePlayerReputations(playerid, amount)
  50. {
  51.   RepInfo[playerid][Reps] += amount;
  52.   return 1;
  53. }
  54.  
  55. stock GivePlayerReputationsEx(playerid, amount, color, comment[])
  56. {
  57.   CallLocalFunction("OnPlayerRepChange", "idd", playerid, RepInfo[playerid][Reps], RepInfo[playerid][Reps] + amount);
  58.   new lstr[128];
  59.   RepInfo[playerid][Reps] += amount;
  60.   format(lstr, sizeof(lstr), "%s", comment);
  61.   SendClientMessage(playerid, color, lstr);
  62.   return 1;
  63. }
  64.  
  65. stock GetPlayerReputations(playerid)
  66. {
  67.   return RepInfo[playerid][Reps];
  68. }
  69.  
  70.  
  71. public OnPlayerConnect(playerid)
  72. {
  73.   ResetPlayerReputations(playerid);
  74.   CallLocalFunction("L_OnPlayerConnect", "i", playerid);
  75.   return 1;
  76. }
  77.  
  78. #if defined _ALS_OnPlayerConnect
  79.    #undef OnPlayerConnect
  80. #else
  81. #define _ALS_OnPlayerConnect
  82. #endif
  83.  
  84. #define OnPlayerConnect L_OnPlayerConnect
  85.  
  86. forward L_OnPlayerConnect(playerid);
  87. forward OnPlayerRepChange(playerid, oldreps, newreps);
  88. /*L-Reputations Include created by Lordz™
  89. Copyright (c) 2012 L-Reputations.*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement