Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*[Include]L-Reputation System by Lordz™.
- You are not allowed to re-release this or claim as yours.
- If you find any bugs or mistakes, post it on L-Reputation System topic.*/
- #define author Lordz
- #if defined Lreps_included
- #endinput
- #endif
- #define Lreps_included
- #if !defined author
- #error "Please define author. #define author Lordz"
- #endif
- #include <a_samp>
- enum pRep
- {
- Reps,
- }
- new RepInfo[MAX_PLAYERS][pRep];
- stock SetPlayerReputations(playerid, amount)
- {
- CallLocalFunction("OnPlayerRepChange", "idd", playerid, RepInfo[playerid][Reps], RepInfo[playerid][Reps] = amount);
- RepInfo[playerid][Reps] = 0;
- RepInfo[playerid][Reps] = amount;
- return 1;
- }
- stock ResetPlayerReputations(playerid)
- {
- CallLocalFunction("OnPlayerRepChange", "idd", playerid, RepInfo[playerid][Reps], RepInfo[playerid][Reps] = 0);
- RepInfo[playerid][Reps] = 0;
- return 1;
- }
- stock ResetPlayerReputationsEx(playerid, reason[])
- {
- CallLocalFunction("OnPlayerRepChange", "idd", playerid, RepInfo[playerid][Reps], RepInfo[playerid][Reps] = 0);
- new str[128];
- RepInfo[playerid][Reps] = 0;
- format(str, sizeof(str), "Your reputations has been automatically reset. Reason:%s", reason);
- SendClientMessage(playerid, -1, str);
- return 1;
- }
- stock GivePlayerReputations(playerid, amount)
- {
- RepInfo[playerid][Reps] += amount;
- return 1;
- }
- stock GivePlayerReputationsEx(playerid, amount, color, comment[])
- {
- CallLocalFunction("OnPlayerRepChange", "idd", playerid, RepInfo[playerid][Reps], RepInfo[playerid][Reps] + amount);
- new lstr[128];
- RepInfo[playerid][Reps] += amount;
- format(lstr, sizeof(lstr), "%s", comment);
- SendClientMessage(playerid, color, lstr);
- return 1;
- }
- stock GetPlayerReputations(playerid)
- {
- return RepInfo[playerid][Reps];
- }
- public OnPlayerConnect(playerid)
- {
- ResetPlayerReputations(playerid);
- CallLocalFunction("L_OnPlayerConnect", "i", playerid);
- return 1;
- }
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect L_OnPlayerConnect
- forward L_OnPlayerConnect(playerid);
- forward OnPlayerRepChange(playerid, oldreps, newreps);
- /*L-Reputations Include created by Lordz™
- Copyright (c) 2012 L-Reputations.*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement