• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua [TFS 0.X] Reputation System

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,402
Solutions
17
Reaction score
150
Location
Brazil
Hello everyone, everything good?

I need a reputation system for OTX 2 (TFS 0.X) that works like this:

  • Reputation will be stored in storage (144712).
  • Will work with talkaction using command: /rep player_name
  • 1 rep every 24 hours per IP
  • Each injustice kill reduces rep by 1 (not obligatory)

I don't want any bonuses or anything, I'm just going to build a rank on the site with reputation storage. If you can see another way for players to circumvent the system, please add it. Thanks for listening.
 
Last edited:
A command to check your rep points:
Lua:
<talkaction words="/rep" event="buffer" value="doPlayerSendTextMessage(cid, 19, 'Rep points: '..getPlayerStorageValue(cid, 144712)..'.')"/>
A simple way to reduces rep points - if the player is being killed with white, red or black skull then points won't be reduced.
Lua:
function onKill(cid, target)
    if isPlayer(cid) and isPlayer(target) and not isInArray({3, 4, 5}, getCreatureSkullType(target)) then
        setPlayerStorageValue(cid, 144712, getPlayerStorageValue(cid, 144712) - 1)
        doPlayerSendTextMessage(cid, 19, "You have just commited unjustified kill. -1 REP point!")
        end
    return true
end
XML
Lua:
<event type="kill" name="repKill" event="script" value="repKill.lua"/>
login.lua
Lua:
registerCreatureEvent(cid, "repKill")
 
Back
Top