• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction (6.1) Cyber's REPSystem w/Opinion Points for 0.4 && mAAC

Is this the best reputation system?

  • Yes.

    Votes: 131 66.2%
  • No.

    Votes: 30 15.2%
  • It's good but can be improved.

    Votes: 37 18.7%

  • Total voters
    198
  • Poll closed .
Status
Not open for further replies.

Can you try change the highscore to add Reoputation on rank is than easy im busy on moment to help you but if not found they way when finish mine server quests i help you on web page
 
@up wtf?
btw I already fixed his problem :)
 
Cyber, good release.
I like also how your thread name spams the hell outa section. :p
 
Sorry but with this script in MODS players can't die on OT :/
When I have that script on my OT and someone die by another player he will have 0 hp, but he didn't died, he can't die and he don't have his HP bar below his character, please fix that :)

tfs 0.3.5 pl1
 
Last edited:
Sorry but with this script in MODS players can't die on OT :/
When I have that script on my OT and someone die by another player he will have 0 hp, but he didn't died, he can't die and he don't have his HP bar below his character, please fix that :)

tfs 0.3.5 pl1
lol I fixed that error centuries ago!!:ninja: you are losing a very good feature dude
 
@Cybermaster

can you tell me the fix? i have the same problem with the line 6 error same like kn4tseb.
 
@up wtf?
btw I already fixed his problem :)

Not on server i say to add rep on page highscore not on game thats is too easy than make another php code just add new rank on highscore page ... Sorry but mine english is bad and maybe you dont understod what i can say ...
 
hmm sorry but that's unnecesarry, remember that this system is in-game
 
hmm sorry but that's unnecesarry, remember that this system is in-game
yeah but with Gesiors site you can see a a full rank or a lot of players who has on rank ...
Maybe it help a lot of ppl try to make a Poll to ppl vote and see what they like ... Its just a idea to help you
And mine rep script works fine thanks a lot cyber
 
lol I fixed that error centuries ago!!:ninja: you are losing a very good feature dude


Lol dude sorry but I was testing the newest (4.1.2 version) and it have this bug -.-

Code:
   <?xml version="1.0" encoding="UTF-8"?>
<mod name="THE BestReputation System, by Cybermaster
CREDITS:
-darkkhaos (sql queries)
-colandus (timestring function)
-onlook (zonet)
-repsystem talkaction (Sync)
-highscore (Shawak)
-php web(Makromango)
And me! I must say that these people didn't help me directly, I just fixed their
scripts to fit them on my sys, some of them had unnecessary codes.
the rep functions, the remaining scripts, the idea and the sys is 100% by me."

version="4.1" author="Cybermaster" contact="[email protected]" enabled="yes">

<config name="repFunctions"><![CDATA[
function getRepPoints(cid)
local Info = db.getResult("SELECT `rep` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
    local p = Info:getDataInt("rep")
    Info:free()
    return p
end

function getRepRank(points)
if points <= -5000 then
        REP_RANK = "Power Abuser (***==========)"
elseif points > -5000 and points <= -1500 then
        REP_RANK = "Evil (=**==========)"
elseif points > -1500 and points <= -1000 then
        REP_RANK = "Gangster (==*==========)"
elseif points > -1000 and points <= -500 then
        REP_RANK = "Villain (===|=========)"
elseif points > -500 and points <= -300 then
        REP_RANK = "PK (====|========)"
elseif points > -300 and points <= -1 then
        REP_RANK = "Bad Guy (======|======)"
elseif points >= 0 and points < 300 then
        REP_RANK = "Noob (======|======)"
elseif points >= 300 and points < 500 then
        REP_RANK = "Well-Known (=======|=====)"
elseif points >= 500 and points < 1000 then
        REP_RANK = "Popular (========|====)"
elseif points >= 1000 and points < 1500 then
        REP_RANK = "Hailed (=========|===)"
elseif points >= 1500 and points < 2000 then
        REP_RANK = "The Best (==========+==)"
elseif points >= 2000 and points < 5000 then
        REP_RANK = "Hero (==========++=)"
elseif points >= 5000 then
        REP_RANK = "Legendary Hero (==========+++)"
end
        return REP_RANK
end

function setPlayerRep(cid, points)
    db.executeQuery("UPDATE `players` SET `rep` = " .. points .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end

function addPlayerRep(cid, amount, color)
        db.executeQuery("UPDATE `players` SET `rep` = `rep` + " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
        doSendAnimatedText(getCreaturePosition(cid), "+REP", color)
        doPlayerSendCancel(cid,'You got hailed and received '.. amount ..' rep points.')
end

function removePlayerRep(cid, amount, color)
    db.executeQuery("UPDATE `players` SET `rep` = `rep` - " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
        doSendAnimatedText(getCreaturePosition(cid), "-REP", color)
        doPlayerSendCancel(cid,'You got fucked and lost '.. amount ..' rep points.')    
end

function repTime(timeDiff) --configured for 6 hours, pm me if you dont know how to change it
    local dateFormat = {    
        --{"day", timeDiff / 60 / 60 / 24 % 7},
                {"hour", timeDiff / 60 / 60 % 6},
        {"minute", timeDiff / 60 % 60},
        {"second", timeDiff % 60}
    }

    local out = {}
    for k, t in ipairs(dateFormat) do
        local v = math.floor(t[2])
        if(v > 0) then
            table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
        end
    end
   
    return table.concat(out)
end

function isPlayerFemale(cid)
        return getPlayerSex(cid) == 0 and true or false
end]]></config>
       
        <event type="login" name="repRegister" event="script"><![CDATA[
        domodlib('repFunctions')
        function onLogin(cid)
                registerCreatureEvent(cid, "repLook")  
                registerCreatureEvent(cid, "repDeath")
                registerCreatureEvent(cid, "repKill")  
                registerCreatureEvent(cid, "repMonster")
        return true
        end]]></event>
       
        <event type="look" name="repLook" event="script"><![CDATA[
        domodlib('repFunctions')
        function onLook(cid, thing, position, lookDistance)
                if(isPlayer(thing.uid) == true) then
                        if(thing.uid == cid) then
                                doPlayerSendTextMessage(cid, 20, "You are "..getRepRank(getRepPoints(cid)).."")
                        else
                                doPlayerSendTextMessage(cid, 20, ""..getCreatureName(thing.uid).." is "..getRepRank(getRepPoints(thing.uid)).."")
                        end
                return true
                end            
        return true
        end]]></event>
       
        <event type="death" name="repDeath" event="script"><![CDATA[
        domodlib('repFunctions')
        function onDeath(cid, corpse, deathList)  
        if (isPlayer(cid) == true) then
                        if (getRepPoints(cid)==0) then
                                return true
                        elseif (getRepPoints(cid) > 0) then
                                removePlayerRep(cid, 5, TEXTCOLOR_RED)
                        else
                                addPlayerRep(cid, 5, TEXTCOLOR_RED)
                        end
        return true
        end
        end]]></event>
               
        <event type="kill" name="repKill" event="script"><![CDATA[
        domodlib('repFunctions')
        function onKill(cid, target, lastHit)
                if (isPlayer(cid) == true) and (isPlayer(target) == true) then
                        if getPlayerSkullType(target) == SKULL_WHITE then
                                addPlayerRep(cid, 15, TEXTCOLOR_LIGHTBLUE)
                        elseif getPlayerSkullType(target) == SKULL_RED then
                                addPlayerRep(cid, 30, TEXTCOLOR_LIGHTBLUE)
                        elseif getPlayerSkullType(target) == SKULL_BLACK then
                                addPlayerRep(cid, 45, TEXTCOLOR_LIGHTBLUE)
                        elseif getPlayerSkullType(target) == SKULL_NONE then
                                removePlayerRep(cid, 30, TEXTCOLOR_RED)
                        end
                else
                        return TRUE
                end
        end]]></event>
               
        <event type="kill" name="repMonster" event="script"><![CDATA[
        domodlib('repFunctions')
        -- >>> To add a new monster, copy an ..elseif.. line and modify it<<< --
        function onKill(cid, target, lastHit)
                if (isPlayer(cid) == true) and (isMonster(target) == true) then
                        if getCreatureName(target) == "Demon" then
                                addPlayerRep(cid, 10, TEXTCOLOR_LIGHTGREEN)
                        elseif getCreatureName(target) == "Behemoth" then
                                        addPlayerRep(cid, 5, TEXTCOLOR_LIGHTGREEN)
                        elseif getCreatureName(target) == "Orshabaal" then
                                addPlayerRep(cid, 15, TEXTCOLOR_LIGHTGREEN)
                        elseif getCreatureName(target) == "Hellfire Fighter" then
                                        addPlayerRep(cid, 5, TEXTCOLOR_LIGHTGREEN)
                        end    
                end
        return TRUE
        end]]></event>
       
        <talkaction log= "yes" words="/hail; /fuck; /set" access="4" event="buffer"><![CDATA[
        domodlib('repFunctions')
        -- >>> t[1] is Player Name, t[2] is Rep Amount<<< --
       
                if(param == "") then
                        doPlayerSendCancel(cid,"You have to type a player name.")
                return TRUE
                end

                local t = string.explode(param, ",")
                local tid = getPlayerByName(t[1])

                if(isPlayer(tid) == false) then
                        doPlayerSendCancel(cid, "Player " .. param .. " not found or is offline.")
                return TRUE
                end
       
                if isPlayerFemale(tid) == true then
                        sex = 'she'
                                else
                        sex = 'he'
                end
       
                if(not t[2]) and (isPlayer(tid) == true) then  
                        if (words == '/hail') then
                                addPlayerRep(tid, 5, TEXTCOLOR_TEAL)
                                doPlayerSendCancel(cid, "You added +5 rep points to " .. getPlayerName(tid) .. ", and now " .. sex .. " has " .. getRepPoints(tid) .. " rep points.")
                        return true
                        end
               
                        if words == '/fuck' then
                                removePlayerRep(tid, 5, TEXTCOLOR_RED)
                                doPlayerSendCancel(cid, "You removed -5 rep points to " .. getPlayerName(tid) .. ", and now " .. sex .. " has " .. getRepPoints(tid) .. " rep points.")
                        return true
                        end
                end
       
                if (t[2]) and (words == '/set') or (words == '/hail') or (words == '/fuck') then
                        if (not tonumber(t[2])) then
                                doPlayerSendCancel(cid, "Rep amount invalid.")
                        return true
                        end                                    
                end
       
                if words == '/hail' then
                        addPlayerRep(tid, t[2], TEXTCOLOR_TEAL)
                        doPlayerSendCancel(cid, "You added  " .. t[2] .. " rep points to " .. getPlayerName(tid) .. ", and now " .. sex .. " has " .. getRepPoints(tid) .. " rep points.")
                        return true
                end
               
                if words == '/fuck' then
                        removePlayerRep(tid, t[2], TEXTCOLOR_RED)
                        doPlayerSendCancel(cid, "You removed  " .. t[2] .. " rep points to " .. getPlayerName(tid) .. ", and now " .. sex .. " has " .. getRepPoints(tid) .. " rep points.")
                        return true
                end
               
                if (t[2]) and (words == '/set') then
                        setPlayerRep(tid, t[2])
                        doPlayerSendCancel(cid, "You have set " .. getPlayerName(tid) .. "'s rep points to " .. getRepPoints(tid) .. ".")
                else
                        doPlayerSendCancel(cid, "Absolute rep amount not specified.")
                        return true
                end
       
                if(not t[2]) then
                        doPlayerSendCancel(cid, "Absolute rep amount not specified.")
                        return true
                end
       
                ]]></talkaction>
       
        <talkaction words="!ranks" event="buffer"><![CDATA[
        domodlib('repFunctions')
       
                local players = 10 -- The amount of max players that is shown in each list
                local str, value, name, result = "","","",0,nil -- don't touch --
        if param == "hero" or param == "pos" or param == "+" then
                        str,value,name = "[#]-[Name]-[Points]-[Rank]\n--[Positive Rep Highscores]--\n","rep","name"
                        result = db.getResult("SELECT `name`, `rep` FROM `players` WHERE players.rep > -1 ORDER BY `rep` DESC, `name` ASC;")
                elseif param == "evil" or param == "neg" or param == "-" then
                        str,value,name = "[#]-[Name]-[Points]-[Rank]\n--[Negative Rep Highscores]--\n","rep","name"
                        result = db.getResult("SELECT `name`, `rep` FROM `players` WHERE players.rep < 0 ORDER BY `rep` ASC, `name` DESC;")    
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unknown Paramater: '" .. param .. "'")
                        return TRUE
                end

                if (result:getID() ~= -1) then
                        local i = 1
                        while TRUE do
                                str = str .. "\n " .. i .. ". - " .. result:getDataString("name") .. " - [" .. result:getDataInt(value) .. "] - " .. getRepRank(result:getDataInt(value)) .. ""
                                i = i+1
                                if not(result:next()) or i > players then
                                        break
                                end
                        end
                        result:free()
                end
                if str ~= "" then
                        doPlayerPopupFYI(cid, str)
                end
                return TRUE
        ]]></talkaction>
       
        <talkaction words="!rep" event="buffer"><![CDATA[
        domodlib('repFunctions')
       
        local o, points, action = getCreatureOutfit(cid), getRepPoints(cid), false --do not modify
        doPlayerSendTextMessage(cid, 19, "You have " .. points .. " rep points. You are " .. getRepRank(points) .. ".")
                if points > 4999 and getPlayerSex(cid) == 0 then --female rep+++ queen outfit
                        disguise, text, action = {lookType = 331}, "Queen!!", true
                elseif points > 4999 and getPlayerSex(cid) > 0 then --male rep+++ king outfit
                        disguise, text, action = {lookType = 332}, "King!!", true
                elseif points > 1999 then --rep++ cm outfit
                        disguise, text, action = {lookType = 266}, "Legend!!", true
                elseif points > 1499 then --rep+ hero outfit
                        disguise, text, action = {lookType = 73}, "Hero!!", true
                elseif points < -4999 then --rep*** devil outfit
                        disguise, text, action = {lookType = 40}, "Devil!!", true
                elseif points < -1999  then --rep** pig outfit --
                        disguise, text, action = {lookType = 60}, "Pig!!", true
                elseif points < -1499 then --rep* orc outfit --
                        disguise, text, action = {lookType = 5}, "Orc!!", true
                end
                if action == true then
                        doCreatureChangeOutfit(cid, disguise)
                        doSendAnimatedText(getCreaturePosition(cid), text, math.random(01,255))
                return true
                end ]]></talkaction>
       
        <talkaction words="!hail" event="buffer"><![CDATA[
        domodlib('repFunctions')
       
        local config =
        {   newTime = 6 * 60 * 60, -- This is [6] hours, in seconds. Time between rep.
                oldTime = getPlayerStorageValue(cid, 23232),
                level = 20,      
                target = getPlayerByName(param)
        }
                if config.oldTime == -1 then
                        setPlayerStorageValue(cid, 23232, os.time())
                end
                       
                local nextTime = config.oldTime - os.time()
                local nextDate = os.date("%d %B %Y %X", config.oldTime + config.newTime)
               
                if getPlayerLevel(cid) < config.level then
                        doPlayerSendCancel(cid,"You may hail from level "..config.level.." and above.")
                return TRUE
                end
       
                if (os.time() - config.oldTime) < config.newTime then
                        doPlayerSendCancel(cid, "You may hail in " .. repTime(nextTime) .. ", (".. nextDate..").")
                return TRUE
                end
       
                if(param == "") then
                        doPlayerSendCancel(cid,"You have to type a player name.")
                return TRUE
                end
       
                if isPlayer(config.target) == false then
                        doPlayerSendCancel(cid,"That player doesn't exist or is offline.")
                return TRUE
                end
               
                if getPlayerIp(cid) == getPlayerIp(config.target) then
                        doPlayerSendCancel(cid,"You may not hail yourself or your same IP.")  
                return TRUE
                end

        addPlayerRep(config.target, 5, TEXTCOLOR_LIGHTBLUE)
        setPlayerStorageValue(cid, 23232, os.time())
        doPlayerSendCancel(cid,'You just hailed '.. getPlayerName(config.target) ..'.')      
    ]]></talkaction>
       
        <talkaction words="!fuck" event="buffer"><![CDATA[
        domodlib('repFunctions')
       
        local config =
        {   newTime = 6 * 60 * 60, -- This is [6] hours, in seconds. Time between rep.
                oldTime = getPlayerStorageValue(cid, 23232),
                level = 20,      
                target = getPlayerByName(param)
        }
                if config.oldTime == -1 then
                        setPlayerStorageValue(cid, 23232, os.time())
                end
                       
                local nextTime = config.oldTime - os.time()
                local nextDate = os.date("%d %B %Y %X", config.oldTime + config.newTime)
               
                if getPlayerLevel(cid) < config.level then
                        doPlayerSendCancel(cid,"You may fuck from level "..config.level.." and above.")
                return TRUE
                end
       
                if (os.time() - config.oldTime) < config.newTime then
                        doPlayerSendCancel(cid, "You may fuck in " .. repTime(nextTime) .. ", (".. nextDate..").")
                return TRUE
                end
       
                if(param == "") then
                        doPlayerSendCancel(cid,"You have to type a player name.")
                return TRUE
                end
       
                if isPlayer(config.target) == false then
                        doPlayerSendCancel(cid,"That player doesn't exist or is offline.")
                return TRUE
                end
       
                if getPlayerIp(cid) == getPlayerIp(config.target) then
                        doPlayerSendCancel(cid,"You may not fuck yourself or your same IP.")  
                return TRUE
                end

        removePlayerRep(config.target, 5, TEXTCOLOR_RED)
        setPlayerStorageValue(cid, 23232, os.time())
        doPlayerSendCancel(cid,'You just fucked '.. getPlayerName(config.target) ..'.')      
    ]]></talkaction>
</mod>

Just test it on tfs 0.3.5 pl1 because on my OT it's not working correctly
 
Lol dude sorry but I was testing the newest (4.1.2 version) and it have this bug -.-

..and where is or which is the bug? and ur distro?

yeah but with Gesiors site you can see a a full rank or a lot of players who has on rank ...
Maybe it help a lot of ppl try to make a Poll to ppl vote and see what they like ... Its just a idea to help you
And mine rep script works fine thanks a lot cyber

well it's not a bad idea, maybe in version 7.0 that will be ready :D
 
but which part/script is not working? I test everything before releasing the scripts
 
[16/11/2009 17:08:38] Loading rep_system.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/rep_system.xml
[16/11/2009 17:08:38] Line: 1, Info: XML declaration allowed only at the start of the document


[16/11/2009 17:08:38] failed!
 
[16/11/2009 17:08:38] Loading rep_system.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/rep_system.xml
[16/11/2009 17:08:38] Line: 1, Info: XML declaration allowed only at the start of the document


[16/11/2009 17:08:38] failed!
fail you!
[16/11/2009 17:36:05] Loading firstitems.xml... done.
[16/11/2009 17:36:05] Loading highscorebook.xml... done.
[16/11/2009 17:36:05] Loading rep_system.xml... done.
[16/11/2009 17:36:05] Loading soccer.xml... done, but disabled.
[16/11/2009 17:36:05] Loading ragnarok_event.xml... done, but disabled.
[16/11/2009 17:36:05] Loading golfsystem.xml... done, but disabled.
[16/11/2009 17:36:05] Loading the_last_stand.xml... done, but disabled.
idk, use this one, but is the same:ninja:

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="THE BestReputation System, by Cybermaster
CREDITS:
-darkkhaos (sql queries)
-colandus (timestring function)
-onlook (zonet)
-repsystem talkaction (Sync)
-highscore (Shawak)
-php web(Makromango)
And me! I must say that these people didn't help me directly, I just fixed their
scripts to fit them on my sys, some of them had unnecessary codes.
the rep functions, the remaining scripts, the idea and the sys is 100% by me."

version="4.1" author="Cybermaster" contact="[email protected]" enabled="yes">

<config name="repFunctions"><![CDATA[
function getRepPoints(cid)
local Info = db.getResult("SELECT `rep` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
    local p = Info:getDataInt("rep")
    Info:free()
    return p
end

function getRepRank(points)
if points <= -5000 then
        REP_RANK = "Power Abuser (***==========)"
elseif points > -5000 and points <= -1500 then
        REP_RANK = "Evil (=**==========)"
elseif points > -1500 and points <= -1000 then
        REP_RANK = "Gangster (==*==========)"
elseif points > -1000 and points <= -500 then
        REP_RANK = "Villain (===|=========)"
elseif points > -500 and points <= -300 then
        REP_RANK = "PK (====|========)"
elseif points > -300 and points <= -1 then
        REP_RANK = "Bad Guy (======|======)"
elseif points >= 0 and points < 300 then
        REP_RANK = "Noob (======|======)"
elseif points >= 300 and points < 500 then
        REP_RANK = "Well-Known (=======|=====)"
elseif points >= 500 and points < 1000 then
        REP_RANK = "Popular (========|====)"
elseif points >= 1000 and points < 1500 then
        REP_RANK = "Hailed (=========|===)"
elseif points >= 1500 and points < 2000 then
        REP_RANK = "The Best (==========+==)"
elseif points >= 2000 and points < 5000 then
        REP_RANK = "Hero (==========++=)"
elseif points >= 5000 then
        REP_RANK = "Legendary Hero (==========+++)"
end
        return REP_RANK
end

function setPlayerRep(cid, points)
    db.executeQuery("UPDATE `players` SET `rep` = " .. points .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end

function addPlayerRep(cid, amount, color)
        db.executeQuery("UPDATE `players` SET `rep` = `rep` + " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
        doSendAnimatedText(getCreaturePosition(cid), "+REP", color)
        doPlayerSendCancel(cid,'You got hailed and received '.. amount ..' rep points.')
end

function removePlayerRep(cid, amount, color)
    db.executeQuery("UPDATE `players` SET `rep` = `rep` - " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
        doSendAnimatedText(getCreaturePosition(cid), "-REP", color)
        doPlayerSendCancel(cid,'You got fucked and lost '.. amount ..' rep points.')    
end

function repTime(timeDiff) --configured for 6 hours, pm me if you dont know how to change it
    local dateFormat = {    
        --{"day", timeDiff / 60 / 60 / 24 % 7},
                {"hour", timeDiff / 60 / 60 % 6},
        {"minute", timeDiff / 60 % 60},
        {"second", timeDiff % 60}
    }

    local out = {}
    for k, t in ipairs(dateFormat) do
        local v = math.floor(t[2])
        if(v > 0) then
            table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
        end
    end
   
    return table.concat(out)
end

function isPlayerFemale(cid)
        return getPlayerSex(cid) == 0 and true or false
end]]></config>
       
        <event type="login" name="repRegister" event="script"><![CDATA[
        domodlib('repFunctions')
        function onLogin(cid)
                registerCreatureEvent(cid, "repLook")  
                registerCreatureEvent(cid, "repDeath")
                registerCreatureEvent(cid, "repKill")  
                registerCreatureEvent(cid, "repMonster")
        return true
        end]]></event>
       
        <event type="look" name="repLook" event="script"><![CDATA[
        domodlib('repFunctions')
        function onLook(cid, thing, position, lookDistance)
                if(isPlayer(thing.uid) == true) then
                        if(thing.uid == cid) then
                                doPlayerSendTextMessage(cid, 20, "You are "..getRepRank(getRepPoints(cid)).."")
                        else
                                doPlayerSendTextMessage(cid, 20, ""..getCreatureName(thing.uid).." is "..getRepRank(getRepPoints(thing.uid)).."")
                        end
                return true
                end            
        return true
        end]]></event>
       
        <event type="death" name="repDeath" event="script"><![CDATA[
        domodlib('repFunctions')
        function onDeath(cid, corpse, deathList)  
        if (isPlayer(cid) == true) then
                        if (getRepPoints(cid)==0) then
                                return true
                        elseif (getRepPoints(cid) > 0) then
                                removePlayerRep(cid, 5, TEXTCOLOR_RED)
                        else
                                addPlayerRep(cid, 5, TEXTCOLOR_RED)
                        end
        return true
        end
        end]]></event>
               
        <event type="kill" name="repKill" event="script"><![CDATA[
        domodlib('repFunctions')
        function onKill(cid, target, lastHit)
                if (isPlayer(cid) == true) and (isPlayer(target) == true) then
                        if getPlayerSkullType(target) == SKULL_WHITE then
                                addPlayerRep(cid, 15, TEXTCOLOR_LIGHTBLUE)
                        elseif getPlayerSkullType(target) == SKULL_RED then
                                addPlayerRep(cid, 30, TEXTCOLOR_LIGHTBLUE)
                        elseif getPlayerSkullType(target) == SKULL_BLACK then
                                addPlayerRep(cid, 45, TEXTCOLOR_LIGHTBLUE)
                        elseif getPlayerSkullType(target) == SKULL_NONE then
                                removePlayerRep(cid, 30, TEXTCOLOR_RED)
                        end
                else
                        return TRUE
                end
        end]]></event>
               
        <event type="kill" name="repMonster" event="script"><![CDATA[
        domodlib('repFunctions')
        -- >>> To add a new monster, copy an ..elseif.. line and modify it<<< --
        function onKill(cid, target, lastHit)
                if (isPlayer(cid) == true) and (isMonster(target) == true) then
                        if getCreatureName(target) == "Demon" then
                                addPlayerRep(cid, 10, TEXTCOLOR_LIGHTGREEN)
                        elseif getCreatureName(target) == "Behemoth" then
                                        addPlayerRep(cid, 5, TEXTCOLOR_LIGHTGREEN)
                        elseif getCreatureName(target) == "Orshabaal" then
                                addPlayerRep(cid, 15, TEXTCOLOR_LIGHTGREEN)
                        elseif getCreatureName(target) == "Hellfire Fighter" then
                                        addPlayerRep(cid, 5, TEXTCOLOR_LIGHTGREEN)
                        end    
                end
        return TRUE
        end]]></event>
       
        <talkaction log= "yes" words="/hail; /fuck; /set" access="4" event="buffer"><![CDATA[
        domodlib('repFunctions')
        -- >>> t[1] is Player Name, t[2] is Rep Amount<<< --
       
                if(param == "") then
                        doPlayerSendCancel(cid,"You have to type a player name.")
                return TRUE
                end

                local t = string.explode(param, ",")
                local tid = getPlayerByName(t[1])

                if(isPlayer(tid) == false) then
                        doPlayerSendCancel(cid, "Player " .. param .. " not found or is offline.")
                return TRUE
                end
       
                if isPlayerFemale(tid) == true then
                        sex = 'she'
                                else
                        sex = 'he'
                end
       
                if(not t[2]) and (isPlayer(tid) == true) then  
                        if (words == '/hail') then
                                addPlayerRep(tid, 5, TEXTCOLOR_TEAL)
                                doPlayerSendCancel(cid, "You added +5 rep points to " .. getPlayerName(tid) .. ", and now " .. sex .. " has " .. getRepPoints(tid) .. " rep points.")
                        return true
                        end
               
                        if words == '/fuck' then
                                removePlayerRep(tid, 5, TEXTCOLOR_RED)
                                doPlayerSendCancel(cid, "You removed -5 rep points to " .. getPlayerName(tid) .. ", and now " .. sex .. " has " .. getRepPoints(tid) .. " rep points.")
                        return true
                        end
                end
       
                if (t[2]) and (words == '/set') or (words == '/hail') or (words == '/fuck') then
                        if (not tonumber(t[2])) then
                                doPlayerSendCancel(cid, "Rep amount invalid.")
                        return true
                        end                                    
                end
       
                if words == '/hail' then
                        addPlayerRep(tid, t[2], TEXTCOLOR_TEAL)
                        doPlayerSendCancel(cid, "You added  " .. t[2] .. " rep points to " .. getPlayerName(tid) .. ", and now " .. sex .. " has " .. getRepPoints(tid) .. " rep points.")
                        return true
                end
               
                if words == '/fuck' then
                        removePlayerRep(tid, t[2], TEXTCOLOR_RED)
                        doPlayerSendCancel(cid, "You removed  " .. t[2] .. " rep points to " .. getPlayerName(tid) .. ", and now " .. sex .. " has " .. getRepPoints(tid) .. " rep points.")
                        return true
                end
               
                if (t[2]) and (words == '/set') then
                        setPlayerRep(tid, t[2])
                        doPlayerSendCancel(cid, "You have set " .. getPlayerName(tid) .. "'s rep points to " .. getRepPoints(tid) .. ".")
                else
                        doPlayerSendCancel(cid, "Absolute rep amount not specified.")
                        return true
                end
       
                if(not t[2]) then
                        doPlayerSendCancel(cid, "Absolute rep amount not specified.")
                        return true
                end
       
                ]]></talkaction>
       
        <talkaction words="!ranks" event="buffer"><![CDATA[
        domodlib('repFunctions')
       
                local players = 10 -- The amount of max players that is shown in each list
                local str, value, name, result = "","","",0,nil -- don't touch --
        if param == "hero" or param == "pos" or param == "+" then
                        str,value,name = "[#]-[Name]-[Points]-[Rank]\n--[Positive Rep Highscores]--\n","rep","name"
                        result = db.getResult("SELECT `name`, `rep` FROM `players` WHERE players.rep > -1 ORDER BY `rep` DESC, `name` ASC;")
                elseif param == "evil" or param == "neg" or param == "-" then
                        str,value,name = "[#]-[Name]-[Points]-[Rank]\n--[Negative Rep Highscores]--\n","rep","name"
                        result = db.getResult("SELECT `name`, `rep` FROM `players` WHERE players.rep < 0 ORDER BY `rep` ASC, `name` DESC;")    
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Unknown Paramater: '" .. param .. "'")
                        return TRUE
                end

                if (result:getID() ~= -1) then
                        local i = 1
                        while TRUE do
                                str = str .. "\n " .. i .. ". - " .. result:getDataString("name") .. " - [" .. result:getDataInt(value) .. "] - " .. getRepRank(result:getDataInt(value)) .. ""
                                i = i+1
                                if not(result:next()) or i > players then
                                        break
                                end
                        end
                        result:free()
                end
                if str ~= "" then
                        doPlayerPopupFYI(cid, str)
                end
                return TRUE
        ]]></talkaction>
       
        <talkaction words="!rep" event="buffer"><![CDATA[
        domodlib('repFunctions')
       
        local o, points, action = getCreatureOutfit(cid), getRepPoints(cid), false --do not modify
        doPlayerSendTextMessage(cid, 19, "You have " .. points .. " rep points. You are " .. getRepRank(points) .. ".")
                if points > 4999 and getPlayerSex(cid) == 0 then --female rep+++ queen outfit
                        disguise, text, action = {lookType = 331}, "Queen!!", true
                elseif points > 4999 and getPlayerSex(cid) > 0 then --male rep+++ king outfit
                        disguise, text, action = {lookType = 332}, "King!!", true
                elseif points > 1999 then --rep++ cm outfit
                        disguise, text, action = {lookType = 266}, "Legend!!", true
                elseif points > 1499 then --rep+ hero outfit
                        disguise, text, action = {lookType = 73}, "Hero!!", true
                elseif points < -4999 then --rep*** devil outfit
                        disguise, text, action = {lookType = 40}, "Devil!!", true
                elseif points < -1999  then --rep** pig outfit --
                        disguise, text, action = {lookType = 60}, "Pig!!", true
                elseif points < -1499 then --rep* orc outfit --
                        disguise, text, action = {lookType = 5}, "Orc!!", true
                end
                if action == true then
                        doCreatureChangeOutfit(cid, disguise)
                        doSendAnimatedText(getCreaturePosition(cid), text, math.random(01,255))
                return true
                end ]]></talkaction>
       
        <talkaction words="!hail" event="buffer"><![CDATA[
        domodlib('repFunctions')
       
        local config =
        {   newTime = 6 * 60 * 60, -- This is [6] hours, in seconds. Time between rep.
                oldTime = getPlayerStorageValue(cid, 23232),
                level = 20,      
                target = getPlayerByName(param)
        }
                if config.oldTime == -1 then
                        setPlayerStorageValue(cid, 23232, os.time())
                end
                       
                local nextTime = config.oldTime - os.time()
                local nextDate = os.date("%d %B %Y %X", config.oldTime + config.newTime)
               
                if getPlayerLevel(cid) < config.level then
                        doPlayerSendCancel(cid,"You may hail from level "..config.level.." and above.")
                return TRUE
                end
       
                if (os.time() - config.oldTime) < config.newTime then
                        doPlayerSendCancel(cid, "You may hail in " .. repTime(nextTime) .. ", (".. nextDate..").")
                return TRUE
                end
       
                if(param == "") then
                        doPlayerSendCancel(cid,"You have to type a player name.")
                return TRUE
                end
       
                if isPlayer(config.target) == false then
                        doPlayerSendCancel(cid,"That player doesn't exist or is offline.")
                return TRUE
                end
               
                if getPlayerIp(cid) == getPlayerIp(config.target) then
                        doPlayerSendCancel(cid,"You may not hail yourself or your same IP.")  
                return TRUE
                end

        addPlayerRep(config.target, 5, TEXTCOLOR_LIGHTBLUE)
        setPlayerStorageValue(cid, 23232, os.time())
        doPlayerSendCancel(cid,'You just hailed '.. getPlayerName(config.target) ..'.')      
    ]]></talkaction>
       
        <talkaction words="!fuck" event="buffer"><![CDATA[
        domodlib('repFunctions')
       
        local config =
        {   newTime = 6 * 60 * 60, -- This is [6] hours, in seconds. Time between rep.
                oldTime = getPlayerStorageValue(cid, 23232),
                level = 20,      
                target = getPlayerByName(param)
        }
                if config.oldTime == -1 then
                        setPlayerStorageValue(cid, 23232, os.time())
                end
                       
                local nextTime = config.oldTime - os.time()
                local nextDate = os.date("%d %B %Y %X", config.oldTime + config.newTime)
               
                if getPlayerLevel(cid) < config.level then
                        doPlayerSendCancel(cid,"You may fuck from level "..config.level.." and above.")
                return TRUE
                end
       
                if (os.time() - config.oldTime) < config.newTime then
                        doPlayerSendCancel(cid, "You may fuck in " .. repTime(nextTime) .. ", (".. nextDate..").")
                return TRUE
                end
       
                if(param == "") then
                        doPlayerSendCancel(cid,"You have to type a player name.")
                return TRUE
                end
       
                if isPlayer(config.target) == false then
                        doPlayerSendCancel(cid,"That player doesn't exist or is offline.")
                return TRUE
                end
       
                if getPlayerIp(cid) == getPlayerIp(config.target) then
                        doPlayerSendCancel(cid,"You may not fuck yourself or your same IP.")  
                return TRUE
                end

        removePlayerRep(config.target, 5, TEXTCOLOR_RED)
        setPlayerStorageValue(cid, 23232, os.time())
        doPlayerSendCancel(cid,'You just fucked '.. getPlayerName(config.target) ..'.')      
    ]]></talkaction>
</mod>
 
Last edited:
Status
Not open for further replies.
Back
Top