A easy repute system for ESX V1 Closing
Initially this script was created inside my drug script: (TBA)
I made a decision I wished to additionally use these options with out rewriting the code for every particular person script, so I ended up taking it from my drug script and permitting it to work independently.
I’m undecided if there are some other repute techniques on the market however I made a decision to permit different builders to make use of my system for his or her scripts in the event that they wished to. I created this script utilizing ESX V1 Closing, any model above or under that has not been examined. Now, let’s get into the code.
- Add / Take away Popularity Factors
- Verify for Popularity
esx_reputation.sqlin your database.
- Add this in your server.cfg
How To Use
When gamers load into the server esx_reputation will examine for an present repute. If no repute is discovered one shall be made.
So as to add/take away repute factors use the next (Shopper):
So as to add/take away repute factors use the next (Server):
TriggerClientEvent('esx_reputation:addReputation', supply, worth)
To examine for gamers repute use the next:
ESX.TriggerServerCallback('esx_reputation:getReputation', operate(repute) -- Insert Code Right here -- finish)
Right here is an instance how it may be used:
ESX.TriggerServerCallback('esx_reputation:getReputation', operate(repute) native playerReputation = repute if playerReputation >= 70 then -- If the participant's repute is larger than or equal to 70, do the next print('You handed the take a look at!') else print('You failed the take a look at!') finish finish)
Model 1.0 (Newest Model)
The minimal repute worth is 0 whereas the utmost repute is 100. No want to fret about going over/underneath the minimal and most, when repute is added or subtracted it’ll examine to verify it stays above 0 and under 100.
That is my first public launch, I’ll be completely happy to reply any questions you could have, assist shall be offered.