SA-MP Forums Archive
[FilterScript] Neil's Reputation System | MySQL - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Neil's Reputation System | MySQL (/showthread.php?tid=427986)



Neil's Reputation System | MySQL - Neil. - 04.04.2013


Info
* MySQL.
* Auto creates the `repinfo` table. With the proper columns (which are; username and reps)
* Auto creates the players accounts on player connect (Once a player connects it adds a new row onto the table repinfo with the players username and 0 rep)
* Reputation Points are based on score (i.e You can reputate 1 point when your score is less than 50 and 2 points if it's more than or equal to 50 but less than 120 based on the default).
* 30 Minutes waiting time before you're able to reputate again.












pawn Код:
//Your MySQL Setup
#define host "localhost"
#define user "root"
#define db "testpurpose"
#define password ""



// Time to wait before a player can rep again. (In Milliseconds, default is set to 30 mins)
#define TimetoWait 1800000


#define First.RequiredScore 50         // When a player has less than 50 score and does /rep other players, he's gonna give them,
    #define FirstRepPoints 1           // 1 Reputation Point
   
#define Second.RequiredScore 120       // When a players score is < 120 but >= 50 and does /rep other players, he's gonna give them,
    #define SecondRepPoints 2          // 2 Reputation Point
   
#define Third.RequiredScore 200
    #define ThirdRepPoints 3           // You get the point here
   
#define Fourth.RequiredScore 330
    #define FourthRepPoints 4          // Change all values of the defines to your preference
   
#define Fifth.RequiredScore 400
    #define FifthRepPoints 5


Set to true if you want to view user's reputation via OnPlayerClickPlayer else set it to false.
pawn Код:
new bool:USEonPlayerClickPlayer = true;


SCREENSHOTS
Had to test it myself. So what you see in the screenshot is me reputating myself solely for testing purposes.




Commands
/rep [playerid]
/checkrep [playerid]
/myrep



CREDITS
* to BlueG's MySQL Plugin
* to ******'s Sscanf Plugin
* to Zeex for the ZCMD Command Processor
* to Neil for the scripting


Link
Solidfiles | Pastebin | Mediafire | 4Shared | DepositFiles

All but Pastebin includes the proper MySQL, Sscanf, Zcmd plugins and includes.




Re: Neil's Reputation System | MySQL - Lostlife - 04.04.2013

This is nice, can you rep someone more then once?


Re: Neil's Reputation System | MySQL - Neil. - 04.04.2013

Quote:
Originally Posted by Lostlife
Посмотреть сообщение
This is nice, can you rep someone more then once?
Once you reputate someone, You have to wait until 30 minutes to rep another user. That is to prevent abuse. You can either set it to a much lesser (or longer) time to suit your needs.


Re: Neil's Reputation System | MySQL - Lostlife - 04.04.2013

But can you rep the same person, in other words if I implanted this on my script would users be able to rep there same friend every day, It it possible you could only rep one person once..


Re: Neil's Reputation System | MySQL - Neil. - 04.04.2013

Quote:
Originally Posted by Lostlife
Посмотреть сообщение
But can you rep the same person, in other words if I implanted this on my script would users be able to rep there same friend every day, It it possible you could only rep one person once..
Hmm. Good point; I'll take that into perspective. I'll probably release a newer version that'll let you rep a person once.


Re: Neil's Reputation System | MySQL - Lostlife - 06.04.2013

Quote:
Originally Posted by Neil.
Посмотреть сообщение
Hmm. Good point; I'll take that into perspective. I'll probably release a newer version that'll let you rep a person once.
Hah looking forward to it, if you make it I'll be sure to use it.