• 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!

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.

hodleo

Formerly cbrm -Crypto enthusiast, Retired scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,598
Solutions
3
Reaction score
955
Location
Caribbean Sea
es8bi1.jpg

Cyber's REPutation System
scripted for TFS 0.3.6 && 0.4
tested with Gesior AAC && ModernAAC
aviarylwotddnscombrpict.png


Special Thanks to:​
Sync,Shawak,Chris,nsanee,5mok3


All users of this system are advised to update to the last revision.
Rev6.0+6.1 Update Log
-Removed globalevent, it was buggy.
-Added PvP tile check, rep won't be affected when players are killed in that type of tile.
-Code slightly reduced.
-Deprecated Rep getTime function.
-New feature: Opinion Points.
-Function onLook updated, to show your rank at your description.
-Commands !rep && !ranks merged.
-Added exhaustion for !rep command.
-Rep Power Feature is optional, and disabled by default.
-Deprecated Skulls Limitation when killing for rep.
-Added "SameIP" when killing for rep.
-Added "lastKilled" when killing for rep.
-Fixed Rep Highscores talkaction command.
-Added Modern AAC compat., highscores and injection included.
-New Rep Stripes made by 5mok3.
-Pictures for PHP Scripts are hosted at Cyber's tinypic repository.
-Upgraded highscores queries, players with 0 rep are not ranked.
-Enhanced PHP Script for Gesior AAC.

->Features
+ Positive and Negative Ranks
+ Graphic Bar and Names for each rank
+ A player's reputation rank may be seen by clicking on him/her
+ Reputation Outfits for the three best and worst ranks
+ Commands for players to repute other players.
+ Command to see Rep Highscores ingame.
+ Optional Reputation Power Feature, that depends on the player's reputation points.
+ PHP Scripts to show Reputation Highscores.
+ Opinion points that are gained each determined time the player keeps online.
+ Animated text when reputing.
+ Exhaustion when using !rep command.
+ Reputation points are infinite.
+ Fully Customizable System.
+ Extra commands with no limitations for Staff


->Commands

[!rep]
Shows reputation highscores or your reputation info, depending if you param is used or not.
!rep + / !rep 1 -> shows positive rep highscores
!rep - / !rep 2 -> shows negative rep highscores
If param is not used, it'll display your points, opinion points and minutes left to gain more, reputation power and last reputed player. Sets your reputation outfit if you have any.

[!hail]Command to add reputation to a player. The amount depends on your RepPower, though it'll be 5 if RepPower is disabled. You may not hail neither yourself nor anyone from your same IP.->!hail Cyber

[!fuck]
Command to remove reputation to a player. The amount depends on your RepPower, though it'll be 5 if RepPower is disabled. You may not repudiate neither yourself nor anyone from your same IP.->!fuck Cyber

[/hail]Staff command to add specified reputation without limitation.
*If you don't type the amount, the default one will be +5 points.
-> /hail Cyber
*If you type the amount, those specified reputation points will be added to target
-> /hail Cyber,96
[/fuck]Staff command to remove specified reputation without limitation.
*If you don't type the amount, the default one will be -5 points.
-> /fuck Cyber
*If you type the amount, those specified reputation points will be removed to target
-> /fuck Cyber,45

[/set] Staff Command to set absolute reputation points, either positive or negative.
-> /set John,-4500
-> /set John,0

-> /set John,1899


->Functions
rep.getPoints(cid) Returns the amount of a player's reputation points
rep.getRank(points) Returns the reputation rank based on the specified reputation points.
rep.set(amount) Sets absolute reputation points to target.
rep.add(cid, amount, color) Adds reputation amount to target with animated colored text.
rep.remove(cid, amount, color) Subtracts reputation amount to target with animated colored text.
rep.getPower(points) Returns the RepPower based on the specified reputation amount.

->Conditions to gain REP+
> With !hail command
> Quest (+5)
> Killing a PK player (+15)
> Killing a RedSkull player (+30)
> Killing a BlackSkull player (+40)
> Killing certain Monsters (Demon+3) (Behemoth+4) (Orshabaal+10), etc
> You may add more conditions(level advance, monster killing, quests, etc)
...just use function rep.add(cid, amount, color)


->
C
onditions to lose REP-

> With !fuck command (-5)
> When a player is killed by another player that was not same last killer
> Killing NON-SKULLED player (-30)
> You may add more conditions(banned, jailed, littering, rule violation, notations, etc)
...just use function rep.remove(cid, amount, color)



->Download
View attachment Cyber's REPSystem 6.1 [10.2010].zip
>>Pass: otland.net


->Setup


1)Execute SQL query
SQL:
ALTER TABLE `players` ADD COLUMN `rep` INT( 11 ) NOT NULL DEFAULT '0' COMMENT 'Cyber''s REPSystem © OTLand.net';

2) Create mods/rep.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<!-- To use this system, execute query:
 ALTER TABLE `players` ADD COLUMN `rep` INT( 11 ) NOT NULL DEFAULT '0' COMMENT 'Cyber''s REPSystem © OTLand.net';
 -->
<mod name="Cyber's REP System" revision="6.1" author="Cybermaster" web="otland.net" enabled="yes" 
released="August2010" credits="Sync;Shawak;Chris;nsanee"><config name="repSystem"><![CDATA[
    rep = {
        --[[ CONFIG ]]--
		interval = 3 * 60, --This is [3] hours, in minutes. Time to be online to gain [1] Opinion Point.
        minLevel = 20, --From this level onwards player can use commands
        pvpLevel = 30, --Minimum level for PVP Rep'ing
        required = 5, --Opinion points required to repute with talkaction command
		exhaustion = 60, --Seconds to wait to be able to use !rep command again
		power = false, --Use RepPower Feature? OPTIONS 1:true 2:false
        --[[ STORAGES ]]--
		exhaust = 5045, --Exhaustion for !rep command.
		lastName = 5036, --Used to store the last repped's GUID
        lastKilled = 5037, --Used to store the last killed's GUID
        opinion = 5038, --Used to store the opinion points
        online = 5039, --Used to store online minutes
     
		autoOpinion = function(cid)
			if not isPlayer(cid) then 
				return true 
			end
			doCreatureSetStorage(cid, rep.online, getCreatureStorage(cid, rep.online)+1)
			if getCreatureStorage(cid, rep.online) >= rep.interval then
				doCreatureSetStorage(cid, rep.online, 0)
				doSendAnimatedText(getThingPos(cid), '+1', TEXTCOLOR_LIGHTBLUE)
				doCreatureSetStorage(cid, rep.opinion, getCreatureStorage(cid, rep.opinion)+1)
				doPlayerSendTextMessage(cid, 27, 'You have just obtained an opinion point.')
			end
			repEvent = addEvent(rep.autoOpinion, 60 * 1000, cid)
		end,
		
		getPVPOption = function(pos)
			local result = false
			if isInArray({'open','hardcore','optional'}, getConfigValue('worldType')) then
				result = getTileInfo(pos).hardcore and true
			else
				result = getTileInfo(pos).pvp and true
			end
			return result
		end,
		
		getArticle = function(cid, uppercase)
            return (getPlayerSex(cid) ==  0 and (uppercase and 'Sh' or 'sh') or (uppercase and 'H' or 'h')) .. 'e'
        end,
   
        getPoints = function(cid)
            local result = db.getResult('SELECT `rep` FROM `players` WHERE `id` = '.. getPlayerGUID(cid))
			local data = result:getDataInt('rep')
			result:free()
			return data
        end,
   
        getPower = function(points)
            local power = {{0,1},{300,2},{500,3},{1000,4},{1500,5},{2000,6},{5000,7}}
            table.sort(power, function(a, b) return a[1] > b[1] end)
            for _, t in ipairs(power) do     
                if math.abs(points) >= t[1] then
                    return t[2]
                end
            end
            return power[1][2]
        end,
   
        getRank = function(points)
            local ranks = {
                {-5000, 'Power Abuser (*<<==========)'},
                {-2000, 'Evil (=*<==========)'},
                {-1500, 'Slayer (==*==========)'},
                {-1000, 'Killer (===|=========)'},
                {-500, 	'Villain (====|========)'},
                {-300, 	'Creeping (=====|=======)'},
                {0, 	'Unknown (======|======)'},
                {300, 	'Avowed (=======|=====)'},
                {500, 	'Popular (========|====)'},
                {1000, 	'Hailed (=========|===)'},
                {1500, 	'Acclaimed (==========+==)'},
                {2000, 	'Hero (==========>+=)'},
                {5000,	'Legend (==========>>+)'}
            }
            if points > -1 then
                table.sort(ranks, function(a, b) return a[1] > b[1] end)
                for _, t in ipairs(ranks) do if points >= t[1] then return t[2] end end
            else
                table.sort(ranks, function(a, b) return a[1] < b[1] end)
                for _, t in ipairs(ranks) do if points <= t[1] then return t[2] end end
            end        
            return ranks[1][2]
        end,
   
        set = function(cid, points)
            db.executeQuery('UPDATE `players` SET `rep` = ' .. points .. ' WHERE `id` = ' .. getPlayerGUID(cid))
        end,

        add = function(cid, amount, color)
            db.executeQuery('UPDATE `players` SET `rep` = `rep` + ' .. amount .. ' WHERE `id` = ' .. getPlayerGUID(cid))
            doSendAnimatedText(getThingPos(cid), '+REP', color and color or math.random(255))
            doPlayerSendCancel(cid, 'You have just been hailed and gained '.. amount ..' reputation points.')
        end,
   
        remove = function(cid, amount, color)
            db.executeQuery('UPDATE `players` SET `rep` = `rep` - ' .. amount .. ' WHERE `id` = ' .. getPlayerGUID(cid))
            doSendAnimatedText(getThingPos(cid), '-REP',  color and color or math.random(255))
            doPlayerSendCancel(cid, 'You have just been repudiated and lost '.. amount ..' reputation points.')
        end,
		
		format = function(str)
			str = tostring(str):reverse()
			str = str:gsub("(%d)(%d)(%d)", '%1%2%3' .. (',' or ' '), math.ceil(str:len() / 3)-1)
			return str:reverse()
		end,
    }
]]></config>

<event type="login" name="repRegister" event="script"><![CDATA[
    domodlib('repSystem')
    function onLogin(cid)
        repEvent = addEvent(rep.autoOpinion, 60 * 1000, cid)
		if getCreatureStorage(cid, rep.opinion) == -1 then
            doCreatureSetStorage(cid, rep.online, 0)
			doCreatureSetStorage(cid, rep.opinion, 0)
        end
        registerCreatureEvent(cid, "repLook")
		registerCreatureEvent(cid, "repKill")
		registerCreatureEvent(cid, "repMonster")
        return true
    end
]]></event>

<event type="logout" name="repCancel" event="script"><![CDATA[
	domodlib('repSystem')
	function onLogout(cid)
		stopEvent(repEvent)
		return true
	end
]]></event>
       
<event type="look" name="repLook" event="script"><![CDATA[
    domodlib('repSystem')
    function onLook(cid, thing, position, lookDistance)
        if isPlayer(thing.uid) and thing.uid ~= cid then
            doPlayerSetSpecialDescription(thing.uid,'\n'.. rep.getArticle(thing.uid, true)..' is ' .. rep.getRank(rep.getPoints(thing.uid)) ..'.')
			return true
		elseif thing.uid == cid then     
			local string = 'You see yourself.'
			if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
				string = string..' You are '.. getPlayerGroupName(cid) ..'.'
			elseif getPlayerVocation(cid) ~= 0 then
				string = string..' You are '.. getPlayerVocationName(cid) ..'.'
			else
				string = string..' You have no vocation.'
			end
			string = string..' You are '.. rep.getRank(rep.getPoints(cid)) ..'.'
	
			if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
				string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
			end
	
			if getPlayerGuildId(cid) > 0 then 
				string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
				string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
			end 
	
			if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
				string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
				string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
			end
	
			if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
				string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
			end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
			return false
		end
		return true
    end]]>
</event>
               
<event type="kill" name="repKill" event="script"><![CDATA[
    domodlib('repSystem')
    local t = {
        [SKULL_WHITE] = 15,
        [SKULL_RED] = 20,
        [SKULL_BLACK] = 40,
        [SKULL_NONE] = -30,
    }

    function onKill(cid, target, lastHit)
        if isPlayer(cid) and isPlayer(target) and getPlayerIp(cid) ~= getPlayerIp(target) and getCreatureStorage(cid, rep.lastKilled) ~= getPlayerGUID(target) and not getPVPOption(getThingPos(cid)) then
        --THE KILLER
            if t[getCreatureSkullType(target)] and getPlayerLevel(target) >= rep.pvpLevel then
                doSendAnimatedText(getThingPos(cid), getCreatureSkullType(target) == 0 and '-REP' or '+REP', math.random(255))
                doCreatureSetStorage(cid, rep.lastKilled, getPlayerGUID(target))
				rep.set(cid, rep.getPoints(cid)+t[getCreatureSkullType(target)])
                doPlayerSendCancel(cid, 'You '.. (getCreatureSkullType(target) == 0 and 'lose' or 'gain') ..' reputation because you killed a player.')
            end
        --THE VICTIM
            if rep.getPoints(target) == 0 then
                return true
            elseif rep.getPoints(target) > 0 then
                rep.remove(target, 5, TEXTCOLOR_RED)
                doPlayerSendCancel(target, 'You lose reputation because you were killed by a player.')
            else
                rep.add(target, 5, TEXTCOLOR_LIGHTBLUE)
                doPlayerSendCancel(target, 'You lose reputation because you were killed by a player.')
            end
        end
        return true
    end]]>
</event>
               
<event type="kill" name="repMonster" event="script"><![CDATA[
    domodlib('repSystem')
    local monster = { --add monsters names only in lowercase
        ['demon'] = 3,
        ['behemoth'] = 4,
        ['hellfire fighter'] = 5,
        ['orshabaal'] = 10,
    }
    function onKill(cid, target, lastHit)
        if isPlayer(cid) and isMonster(target) and monster[getCreatureName(target):lower()] then
            rep.add(cid, monster[getCreatureName(target):lower()])
        end
        return true
    end]]>
</event>
       
<talkaction log="yes" words="/hail;/fuck;/set" access="4" event="buffer">
	<![CDATA[
		domodlib('repSystem')
        if param == '' then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,'[REP_SYSTEM] You must write a player\'s name.')
            return true
        end

        local t = string.explode(param, ',')
        local tid = getPlayerByNameWildcard(t[1])

        if not isPlayer(tid) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] Player ' .. param .. ' not found.')
            return true
        end
       
        if not t[2] and isPlayer(tid) then  
            if words == '/hail' then
                rep.add(tid, 5, TEXTCOLOR_TEAL)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] You added +5 rep points to ' .. getPlayerName(tid) .. ', and now ' .. rep.getArticle(tid, false) .. ' has ' .. rep.getPoints(tid) .. ' points.')
                return true
            end
               
            if words == '/fuck' then
                rep.remove(tid, 5, TEXTCOLOR_RED)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] You removed -5 rep points to ' .. getPlayerName(tid) .. ', and now ' .. rep.getArticle(tid, false) .. ' has ' .. rep.getPoints(tid) .. ' points.')
                return true
            end
        end
       
        if t[2] and isInArray({'/set','/hail','fuck'}, words) then
            if not tonumber(t[2]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] Reputation amount is invalid.')
				return true
            end                                    
        end
       
        if words == '/hail' then
            rep.add(tid, t[2], TEXTCOLOR_TEAL)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] You added ' .. t[2] .. ' rep points to ' .. getPlayerName(tid) .. ', and now ' .. rep.getArticle(tid, false) .. ' has ' .. rep.getPoints(tid) .. ' points.')
			return true
        end
               
        if words == '/fuck' then
            rep.remove(tid, t[2], TEXTCOLOR_RED)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] You removed ' .. t[2] .. ' rep points to ' .. getPlayerName(tid) .. ', and now ' .. rep.getArticle(tid, false) .. ' has ' .. rep.getPoints(tid) .. ' points.')
			return true
        end
               
        if t[2] and words == '/set' then
            rep.set(tid, t[2])
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] You have set ' .. getPlayerName(tid) .. '\'s points to ' .. rep.getPoints(tid))
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] Absolute reputation amount not specified.')
			return true
        end
       
        if not t[2] then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '[REP_SYSTEM] Absolute reputation amount not specified.')
			return true
        end    
    return true]]>
</talkaction>
              
<talkaction words="!rep" event="buffer"><![CDATA[
    domodlib('repSystem')
	if exhaustion.check(cid, rep.exhaust) then
		doPlayerSendCancel(cid, 'You can\'t use this command yet['..exhaustion.get(cid, rep.exhaust)..'].')
		return true
	else
		exhaustion.set(cid, rep.exhaust, rep.exhaustion)
	end
	
	if param ~= '' then
		local str, value, name, result = '', '',' ', 0, nil
		if isInArray({'hero','pos','1','+'}, param) then
			str,value,name = '[#]-[Name]-[Points]-[Rank]\n--[Positive Reputation Highscores]--\n','rep','name'
			result = db.getResult('SELECT `name`, `rep` FROM `players` WHERE `rep` > 0 AND `name` NOT LIKE "%Sample" AND `name`!= "Account Manager" AND `deleted` = 0 AND `group_id` = 1 ORDER BY `rep` DESC LIMIT 10;')
		elseif isInArray({'evil','neg','2','-'}, param) then
			str,value,name = '[#]-[Name]-[Points]-[Rank]\n--[Negative Reputation Highscores]--\n','rep','name'
			result = db.getResult('SELECT `name`, `rep` FROM `players` WHERE `rep` < 0 AND `name` NOT LIKE "%Sample" AND `name`!= "Account Manager" AND `deleted` = 0 AND `group_id` = 1 ORDER BY `rep` ASC LIMIT 10;')
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Unknown parameter, use only +, -, 1, 2.')
			return true
		end

		if isInArray({-1,nil,false,''},result:getID()) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'No results were found.')
			return true
		end
		local i = 1
		while true do
			str = str .. '\n ' .. i .. '. ' .. result:getDataString('name') .. ' - [' .. result:getDataInt(value) .. '] - ' .. rep.getRank(result:getDataInt(value))
			i = i + 1
			if not(result:next()) then
				break
			end
		end
		result:free()
		doPlayerPopupFYI(cid, str)
		return true
	elseif param == '' then
		local points, action, name = rep.getPoints(cid), false, getPlayerNameByGUID(getCreatureStorage(cid, rep.lastName), false, false)
		doPlayerSendTextMessage(cid, 27, 'You have '.. rep.format(points) ..' reputation points. You have ' .. getCreatureStorage(cid, rep.opinion) .. ' opinion points and you will gain one '.. (getCreatureStorage(cid, rep.opinion) > 0 and 'more ' or '') ..'in '.. rep.interval - getCreatureStorage(cid, rep.online) ..' minutes.'.. (rep.power and ' Your Rep Power is ' .. rep.getPower(points) ..'.' or '')..(name ~= nil and ' You last reputed ' .. name .. '.' or ''))
		if points > 4999 then --female rep+++ queen outfit
			disguise, text, action = getPlayerSex(cid) == 0 and 331 or 332, getPlayerSex(cid) == 0 and 'Queen!!' or 'King!!', true
		elseif points > 1999 then --rep++ cm outfit
			disguise, text, action = 73, 'Hero!!', true
		elseif points > 1499 then --rep+ hero outfit
			disguise, text, action = 63, 'Acclaimed!!', true
		elseif points < -4999 then --rep*** devil outfit
			disguise, text, action = 334, 'P.O.!', true
		elseif points < -1999  then --rep** pig outfit
			disguise, text, action = 306, 'Evil!!', true
		elseif points < -1499 then --rep* orc outfit
			disguise, text, action = 5, "Slayer!!", true  
		end
		
		if action and getCreatureOutfit(cid).lookType ~= disguise then
			doSetCreatureOutfit(cid, {lookType = disguise}, -1)
			doSendAnimatedText(getThingPos(cid), text, math.random(255))
			return true
		end
	end
	return true]]>
</talkaction>
       
<talkaction words="!hail;!fuck" event="buffer"><![CDATA[
    domodlib('repSystem')
    if param == '' then
		doPlayerSendCancel(cid, 'Command requires a player\'s name.')
		return true
    end
       
    local target = getPlayerByNameWildcard(param)
   
    if not isPlayer(target) then
		doPlayerSendCancel(cid, 'That player does not exist or is offline.')
		return true
    end
                                   
    if getPlayerLevel(cid) < rep.minLevel then
		doPlayerSendCancel(cid,'You may repute from level ' .. rep.minLevel ..' onwards.')
		return true
    end
       
    if getPlayerIp(cid) == getPlayerIp(target) then
        doPlayerSendCancel(cid, 'You may not repute neither yourself nor anyone in your IP.')  
		return true
    end
	
	if getPlayerGUID(target) == getCreatureStorage(cid, rep.lastName) then
        doPlayerSendCancel(cid, 'You may not repute that player two times in a row.')  
		return true
    end
   
    if getCreatureStorage(cid, rep.opinion) < rep.required then
		doPlayerSendCancel(cid, 'You do not have enough opinion points to repute.')  
		return true
    end
		                                 
    if words == '!hail' then
        doCreatureSetStorage(cid, rep.lastName, getPlayerGUID(target))
		doCreatureSetStorage(cid, rep.opinion, getCreatureStorage(cid, rep.opinion)-rep.required)
        doPlayerSendCancel(cid, 'You have just reputed ' .. getCreatureName(target) .. '. You have ' .. getCreatureStorage(cid, rep.opinion) .. ' opinion points left.')
		rep.add(target, rep.power and rep.getPower(rep.getPoints(cid)) or 5, TEXTCOLOR_LIGHTBLUE)
    elseif words == '!fuck' then
        doCreatureSetStorage(cid, rep.lastName, getPlayerGUID(target))
		doCreatureSetStorage(cid, rep.opinion, getCreatureStorage(cid, rep.opinion)-rep.required)
        doPlayerSendCancel(cid, 'You have just reputed ' .. getCreatureName(target) .. '. You have ' .. getCreatureStorage(cid, rep.opinion) .. ' opinion points left.')
		rep.remove(target, rep.power and rep.getPower(rep.getPoints(cid)) or 5, TEXTCOLOR_RED)
    end
	return true
]]></talkaction>
</mod>

->ADD'ons

Quests

|> @data/actions/scripts/quests/system.lua
1st line, add
Lua:
domodlib('repSystem')
Before
Lua:
if(questsExperience[storage] ~= nil) then
Add
Lua:
rep.add(cid, 5)

Donations

|>
@data/globalevents/scripts/shop.lua

1st line, add
Lua:
domodlib('repSystem')

After
Lua:
if received_item == RETURNVALUE_NOERROR then
Add
Lua:
rep.add(cid, 1)
 
Last edited:
->ModernAAC

Create new page @ admin panel:
PHP:
<?PHP
/* * * * * * * * * * * * * * * * * * * * * * * 
* Cyber's REPutation System Revision 6.0      *
* Top 10 Players Reputation Highscores Script  *
* Encoded for Modern Automatic Account Creator  *
* Tested with TFS 0.3.6pl1 and ModernAAC Rev.176 *
* * * * * * * * * * * * * * * * * * * * * * * * * */
require("config.php");
require("injections/rep/highscores/function.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
$rep_pos = $SQL->query('SELECT name, rep FROM players WHERE rep > 0 AND name NOT LIKE "%Sample" AND name != "Account Manager" AND deleted = 0 AND group_id = 1 ORDER BY rep DESC LIMIT 10;');
$rep_neg = $SQL->query('SELECT name, rep FROM players WHERE rep < 0 AND name NOT LIKE "%Sample" AND name != "Account Manager" AND deleted = 0 AND group_id = 1 ORDER BY rep ASC LIMIT 10;');
$rep_pos2 = $SQL->query('SELECT name, rep FROM players WHERE rep > 0 AND name NOT LIKE "%Sample" AND name != "Account Manager" AND deleted = 0 AND group_id = 1 ORDER BY rep DESC LIMIT 10;');
$rep_neg2 = $SQL->query('SELECT name, rep FROM players WHERE rep < 0 AND name NOT LIKE "%Sample" AND name != "Account Manager" AND deleted = 0 AND group_id = 1 ORDER BY rep ASC LIMIT 10;');
$players_pos = 0;
$players_neg = 0;
$rank1 = getReputation(5000);
$rank2 = getReputation(2000);
$rank3 = getReputation(1500);
$rank4 = getReputation(1000);
$rank5 = getReputation(500);
$rank6 = getReputation(300);
$rank7 = getReputation(0);
$rank8 = getReputation(-300);
$rank9 = getReputation(-500);
$rank10=getReputation(-1000);
$rank11=getReputation(-1500);
$rank12=getReputation(-2000);
$rank13=getReputation(-5000);

$ide = new IDE;
	try {
		$ide->loadInjections("rep");
		}
	catch(Exception $e) {
		error($e->getMessage());
		}

 foreach($rep_pos2 as $posplayer)
 {
  $players_pos++;
 }
 foreach($rep_neg2 as $negplayer)
 {
  $players_neg++;
 }
$i = 0;
$data1 = 0; 
$players_rows = '';
if ($players_pos) 
	foreach($rep_pos as $player) {
		if(is_int($data1 / 2))
			$bgcolor = '#92cddc';
		else
			$bgcolor = '#daeef3';
		$data1++; 
		$i++;
		$rank = getReputation($player['rep']);
		$players_rows .= '<TABLE CELLSPACING=0 WIDTH=100%><TR>
		<TD WIDTH="44%" BGCOLOR="'.$bgcolor.'">&nbsp;<strong>'.$i.'.</strong><a class="link" href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'"><span class="link">'.$player['name'].'</span></a></TD>
		<TD WIDTH="20%" BGCOLOR="'.$bgcolor.'">&nbsp;'.$player['rep'].'</TD>
		<TD WIDTH="36%" BGCOLOR="'.$bgcolor.'">&nbsp;'.$rank[0].'<br />'.$rank[1].'</TD></TR></TABLE>'; 
	}
else // DO NOT MODIFY
	$players_rows = '&nbsp;There are no players with (+) reputation.';
 
$o = 0;
$data2 = 0; 
$players_rows2 = '';
if ($players_neg) 
 	foreach($rep_neg as $player) {
		if(is_int($data2 / 2))
			$bgcolor = '#f2dbdb';
		else
			$bgcolor = '#d99594';
	$data2++; 
	$o++;
	$rank = getReputation($player['rep']);
	$players_rows2 .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
	<TD WIDTH="44%" BGCOLOR="'.$bgcolor.'">&nbsp;<strong>'.$o.'.</strong><a class="link" href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'"><span class="link">'.$player['name'].'</span></a></TD>
	<TD WIDTH="20%" BGCOLOR="'.$bgcolor.'">&nbsp;'.$player['rep'].'</TD>
	<TD WIDTH="36%" BGCOLOR="'.$bgcolor.'">&nbsp;'.$rank[0].'<br />'.$rank[1].'</TD></TR></TABLE>';
  } 
 else // DO NOT MODIFY
  $players_rows2 .= '&nbsp;There are no players with (-) reputation.';
 
 echo '<br/><TABLE CELLSPACING=0 WIDTH=100% style="border: 1px solid rgb(93, 67, 16);"><TR>
 <TD WIDTH="22%" BGCOLOR="#4682B4"><span style="color:white;font-weight:bold">&nbsp;NAME</span></TD>
 <TD WIDTH="10%" BGCOLOR="#4682B4"><span style="color:white;font-weight:bold">&nbsp;POINTS</span></TD>
 <TD WIDTH="18%" BGCOLOR="#4682B4"><span style="color:white;font-weight:bold">&nbsp;RANK</span></TD>
 <TD WIDTH="22%" BGCOLOR="#800000"><span style="color:white;font-weight:bold">&nbsp;NAME</span></TD>
 <TD WIDTH="10%" BGCOLOR="#800000"><span style="color:white;font-weight:bold">&nbsp;POINTS</span></TD>
 <TD WIDTH="18%" BGCOLOR="#800000"><span style="color:white;font-weight:bold">&nbsp;RANK</span></TD></TR><TR>
 <TD WIDTH="50%" COLSPAN="3" VALIGN="TOP">'.$players_rows.'</TD>
 <TD COLSPAN="3" VALIGN="TOP">'.$players_rows2.'</TD>
 </TR></TABLE><br/>';

 $chart = '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=80% style="border: 1px solid rgb(93, 67, 16);">
<TR align="left">
   <TD WIDTH=25%><strong>RANK</strong></TD>
   <TD WIDTH=19%><strong>OUTFIT</strong></TD>
   <TD WIDTH=15% align="center"><strong>POINTS</strong></TD>
   <TD WIDTH=26% align="center"><strong>BAR</strong></TD>
   <TD WIDTH=15% align="center"><strong>POWER</strong></TD>
</TR>
<TR align="left">
 <TD BGCOLOR="#215868">&nbsp;<span style="color:white;font-weight:bold">'.$rank1[0].'</span><br/>'.$rank1[1].'</TD>
   <TD BGCOLOR="#215868">&nbsp;<img src="http://i25.tinypic.com/2en3oxs.jpg"/></TD>
   <TD BGCOLOR="#215868"><center><span style="color:white;font-weight:bold">5000</span></center></TD>
   <TD BGCOLOR="#215868"><span style="color:white;font-weight:bold;">&nbsp;(============+)</span></TD>
   <TD BGCOLOR="#215868"><center><span style="color:white;font-weight:bold">7</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#31849b">&nbsp;<span style="color:white;font-weight:bold">'.$rank2[0].'</span><br/>'.$rank2[1].'</TD>
   <TD BGCOLOR="#31849b">&nbsp;<img src="http://i31.tinypic.com/52ifll.jpg"/></TD>
   <TD BGCOLOR="#31849b"><center><span style="color:white;font-weight:bold">2000</span></center></TD>
   <TD BGCOLOR="#31849b">&nbsp;<span style="color:white;font-weight:bold">(===========+=)</span></TD>
   <TD BGCOLOR="#31849b"><center><span style="color:white;font-weight:bold">6</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#4bacc6"><span style="color:white;font-weight:bold">&nbsp;'.$rank3[0].'</span><br/>'.$rank3[1].'</TD>
   <TD BGCOLOR="#4bacc6">&nbsp;<img src="http://i32.tinypic.com/68d7xx.jpg"/></TD>
   <TD BGCOLOR="#4bacc6"><center><span style="color:white;font-weight:bold">1500</span></center></TD>
   <TD BGCOLOR="#4bacc6"><span style="color:white;font-weight:bold">&nbsp;(==========+==)</span></TD>
   <TD BGCOLOR="#4bacc6"><center><span style="color:white;font-weight:bold">5</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#92cddc"><span style="color:back;font-weight:bold">&nbsp;'.$rank4[0].'</span><br/>'.$rank4[1].'</TD>
   <TD BGCOLOR="#92cddc"></TD>
   <TD BGCOLOR="#91cddc"><center><span style="color:black;font-weight:bold">1000</span></center></TD>
   <TD BGCOLOR="#92cddc"><strong>&nbsp;(=========|===)</strong></TD>
   <TD BGCOLOR="#92cddc"><center><strong>4</strong></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#b6dde8"><strong>&nbsp;<span style="color:black;font-weight:bold">'.$rank5[0].'</span><br/>'.$rank5[1].'</TD>
   <TD BGCOLOR="#b6dde8"></TD>
   <TD BGCOLOR="#b6dde8"><center><span style="color:black;font-weight:bold">500</span></center></TD>
   <TD BGCOLOR="#b6dde8">&nbsp;<span style="color:black;font-weight:bold">(========|====)</span></TD>
   <TD BGCOLOR="#b6dde8"><center><span style="color:black;font-weight:bold">3</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#daeef3"><strong>&nbsp;<span style="color:black;font-weight:bold">'.$rank6[0].'</span><br/>'.$rank6[1].'</TD>
   <TD BGCOLOR="#daeef3"></TD>
   <TD BGCOLOR="#daeef3"><center><span style="color:black;font-weight:bold">300</span></center></TD>
   <TD BGCOLOR="#daeef3">&nbsp;<span style="color:black;font-weight:bold">(=======|=====)</span></TD>
   <TD BGCOLOR="#daeef3"><center><span style="color:black;font-weight:bold">2</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#f2eff5"><span style="color:black;font-weight:bold">&nbsp;'.$rank7[0].'</span><br/>'.$rank7[1].'</TD>
   <TD BGCOLOR="#f2eff5"></TD>
   <TD BGCOLOR="#f2eff5"><center><span style="color:black;font-weight:bold">.0</span></center></TD>
   <TD BGCOLOR="#f2eff5"><span style="color:black;font-weight:bold">&nbsp;(======|======)</span></TD>
   <TD BGCOLOR="#f2eff5"><center><span style="color:black;font-weight:bold">1</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#f2dbdb"><span style="color:black;font-weight:bold">&nbsp;'.$rank8[0].'</span><br/>'.$rank8[1].'</TD>
   <TD BGCOLOR="#f2dbdb"></TD>
   <TD BGCOLOR="#f2dbdb"><center><span style="color:black;font-weight:bold">-300</span></center></TD>
   <TD BGCOLOR="#f2dbdb"><span style="color:black;font-weight:bold">&nbsp;(=====|=======)</span></TD>
   <TD BGCOLOR="#f2dbdb"><center><span style="color:black;font-weight:bold">2</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#e5b8b7"><span style="color:black;font-weight:bold">&nbsp;'.$rank9[0].'</span><br/>'.$rank9[1].'</TD>
   <TD BGCOLOR="#e5b8b7"></TD>
   <TD BGCOLOR="#e5b8b7"><center><span style="color:black;font-weight:bold">-500</span></center></TD>
   <TD BGCOLOR="#e5b8b7"><span style="color:black;font-weight:bold">&nbsp;(====|========)</span></TD>
   <TD BGCOLOR="#e5b8b7"><center><span style="color:black;font-weight:bold">3</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#d99594"><span style="color:black;font-weight:bold">&nbsp;'.$rank10[0].'</span><br/>'.$rank10[1].'</TD>
   <TD BGCOLOR="#d99594"></TD>
   <TD BGCOLOR="#d99594"><center><strong>-1000</strong></center></TD>
   <TD BGCOLOR="#d99594"><strong>&nbsp;(===|=========)</strong></TD>
   <TD BGCOLOR="#d99594"><center><strong>4</strong></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#c0504d"><span style="color:white;font-weight:bold">&nbsp;'.$rank11[0].'</span><br/>'.$rank11[1].'</TD>
   <TD BGCOLOR="#c0504d">&nbsp;<img src="http://i27.tinypic.com/8x8q6e.jpg"/></TD>
   <TD BGCOLOR="#c0504d"><center><span style="color:white;font-weight:bold">-1500</span></center></TD>
   <TD BGCOLOR="#c0504d"><span style="color:white;font-weight:bold;">&nbsp;(==*==========)</span></TD>
   <TD BGCOLOR="#c0504d"><center><span style="color:white;font-weight:bold;">5</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#943634"><span style="color:white;font-weight:bold;">&nbsp;'.$rank12[0].'</span><br/>'.$rank12[1].'</TD>
   <TD BGCOLOR="#943634">&nbsp;<img src="http://i28.tinypic.com/s2v34o.jpg"/></TD>
   <TD BGCOLOR="#943634"><center><span style="color:white;font-weight:bold;">-2000</span></center></TD>
   <TD BGCOLOR="#943634"><span style="color:white;font-weight:bold;">&nbsp;(=*<==========)</span></TD>
   <TD BGCOLOR="#943634"><center><span style="color:white;font-weight:bold;">6</span></center></TD>
</TR>
<TR align="left">
   <TD BGCOLOR="#632423"><span style="color:white;font-weight:bold;">&nbsp;'.$rank13[0].'</span><br/>'.$rank13[1].'</TD>
 <TD BGCOLOR="#632423">&nbsp;<img src="http://i25.tinypic.com/200sk1t.jpg"/></TD>
   <TD BGCOLOR="#632423"><center><span style="color:white;font-weight:bold;">-5000</span></center></TD>
   <TD BGCOLOR="#632423"><span style="color:white;font-weight:bold;">&nbsp;(*<<==========)</span></TD>
   <TD BGCOLOR="#632423"><center><span style="color:white;font-weight:bold;">7</span></center></TD>
</TR></TABLE></center>';
?>

<h1>Reputation Info</h1>
<div align="center" id="hide">
	<p><a href="#" id="example-show" class="showLink" onclick="showHide('example');return false;"><input type="button" value="Click here to show content" /></a></p>	
	<div id="example" class="more">
		<p><a href="#" id="example-hide" class="hideLink" onclick="showHide('example');return false;"><input type="button" value="Click here to hide the information" /></a><br/>
			<table width="100%" border="0" cellpadding="4" cellspacing="0" style="border: 1px solid rgb(93, 67, 16);">
		<tr>
			<td colspan="3" bgcolor="#505050" class="white"><div align="center"><span style="color:white;font-weight:bold;font-size:16px">Reputation Commands</span></div></td>
		</tr>
		<tr bgcolor="#F5F5F5">
			<td width="15%"><div align="center"><font color="black"><b>Command</b></font></div></td>
			<td width="45%"><div align="center"><font color="black"><b>Description</b></font></b></div></td>
			<td width="40%"><font color="black"><b>Example</b></font></td>
		</tr>
		<tr bgcolor="#F8F8FF">
			<td>&nbsp;!rep</td>
			<td>Shows your current points, power, last reputed player and opinion points. Sets your reputation outfit too if you have any.</td>
			<td>!rep</td>
		</tr>
		<tr bgcolor="#F0F8FF">
			<td>&nbsp;!ranks</td>
			<td>Shows the reputation highscores.</td>
			<td>!ranks + or !ranks -</td>
		</tr>

		<tr bgcolor="#F8F8FF">
			<td>&nbsp;!hail</td>
			<td>Adds reputation points to a player depending of your reputation power.</td>
			<td>!hail PLAYERNAME</td>
		</tr>
		<tr bgcolor="#F0F8FF">
			<td>&nbsp;!fuck</td>
			<td>Removes reputation points to a player depending of your reputation power.</td>
			<td>!fuck PLAYERNAME</td>
		</tr>
	</table>
	</center>
	<br><center>
  <table width="100%" border="0" cellspacing="0" style="border: 1px solid rgb(93, 67, 16);">
  <tr> 
    <td colspan="4" bgcolor="#505050"><div align="center"><span style="color:white;font-weight:bold;font-size:16px">Conditions</span></div></td>
  </tr>
  <tr bgcolor="#d4c0a1"> 
    <td colspan="2" bgcolor="#F5F5F5"> <div align="center"><font size="2" color="black">To Gain <font color="#336633"><strong>REP+</strong></font></font></div></td>

    <td colspan="2" bgcolor="#F5F5F5"> <div align="center"><font size="2" color="black">To Lose <font color="#CC3333"><strong>REP-</strong></font></font></div></td>
  </tr>
  <tr bgcolor="#F8F8FF"> 
    <td width="46%">&nbsp;Using <strong><em>!hail</em></strong> command</td>
    <td width="5%"><div align="center"><strong><font color="#006633">???</font></strong></div></td>

    <td width="44%">&nbsp;Using <strong><em>!fuck</em></strong> command</td>
    <td width="5%"><div align="center"><strong><font color="#CC3333">???</font></strong></div></td>
  </tr>
  <tr bgcolor="#F0F8FF"> 
    <td>&nbsp;Killing Monsters</td>
    <td><div align="center"><strong><font color="#006633">???</font></strong></div></td>
	<td>&nbsp;Killing a non-skulled Player</td>
    <td><div align="center"><strong><font color="#CC3333">-30</font></strong></div></td>
  </tr>
  <tr bgcolor="#F8F8FF"> 
    <td>&nbsp;Making a Quest</td>
    <td><div align="center"><strong><font color="#006633">+25</font></strong></div></td>
    <td></td>
    <td></td>
  </tr>
  <tr bgcolor="#F0F8FF"> 
    <td>&nbsp;Killing a white-skull Player</td>
    <td><div align="center"><strong><font color="#006633">+15</font></strong></div></td>
    <td></td>
    <td><div align="center"></div></td>
  </tr>
  <tr bgcolor="#F8F8FF"> 
    <td>&nbsp;Killing a red-skull Player</td>
    <td><div align="center"><strong><font color="#006633">+20</font></strong></div></td>
    <td></td>
    <td><div align="center"></div></td>
  </tr>
  <tr bgcolor="#F0F8FF"> 
    <td>&nbsp;Killing a black-skull Player</td>
    <td><div align="center"><strong><font color="#006633">+40</font></strong></div></td>
    <td></td>
    <td><div align="center"></div></td>
  </tr>
  
</table>
</center>
		</p>
	</div>
</div>

<h1>Reputation Chart</h1>
<div align="center" id="hide">
	<p><a href="#" id="chart-show" class="showLink" onclick="showHide('chart');return false;">
		<input type="button" value="Click here to show content" />
	</a></p>
	<div id="chart" class="more">
		<p><a href="#" id="chart-hide" class="hideLink" onclick="showHide('chart');return false;"><input type="button" value="Click here to hide the chart" /></a><br/><?php echo"".$chart."";?></p>
    </div>
</div><br/><div align="right"><span style="font-size:smaller;text-align:left">Scripted by <a href="http://otland.net/members/cybershot/">Cybermaster</a></span></div><br/><center>This looks better at Firefox.<br/><a href='http://www.mozilla.com/?from=sfx&amp;uid=0&amp;t=556'><img src='http://sfx-images.mozilla.org/firefox/3.6/110x32_get_blue.png' alt='Spread Firefox Affiliate Button' border='0' /></a></center>
<script type="text/javascript">
function showHide(shID) {
   if (document.getElementById(shID)) {
      if (document.getElementById(shID+'-show').style.display != 'none') {
         document.getElementById(shID+'-show').style.display = 'none';
         document.getElementById(shID).style.display = 'block';
      }
      else {
         document.getElementById(shID+'-show').style.display = 'inline';
         document.getElementById(shID).style.display = 'none';
      }
   }
}
</script>
<style type="text/css">
   	.link {text-decoration: none;font-weight:bold;color:black;}
	.more {	display: none;}
</style>

And put the injections in your modern aac folder from /modernaac at download

->GesiorAAC
Paste the files from /gesioraac folder at download in your /htdocs

Search @ characters.php for
PHP:
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Created:</TD><TD>'.date("j F Y, g:i a", $player->getCreated()).'</TD></TR>';

then add below:
PHP:
{
//Cyber's REPutation System
$ranx = getReputation($player->getCustomField("rep"));
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD><B>Reputation:</B></TD><TD>'.$ranx[1].' '.$ranx[0].'</TD></TR>';    
}

Then, open htdocs/config-and-functions.php

Before last "?>" Add:
PHP:
function getReputation($rep) {
	$ranks = array(
            'Power Abuser' => array(null, -5000, '<img height="15" src="http://i29.tinypic.com/66dg0i.jpg" />'),
            'Evil' => array(-4999, -2000, '<img height="15" src="http://i32.tinypic.com/rw0u2f.jpg" />'),
            'Slayer' => array(-1999, -1500, '<img height="15" src="http://i25.tinypic.com/k2zu6h.jpg" />'),
            'Killer' => array(-1499, -1000, '<img height="15" src="http://i28.tinypic.com/xe0tx3.jpg" />'),
            'Villain' => array(-999, -500, '<img height="15" src="http://i31.tinypic.com/50qkxu.jpg" />'),
            'Creeping' => array(-499, -300, '<img height="15" src="http://i31.tinypic.com/wlrjfo.jpg" />'),
            'Unknown' => array(-299, 299, '<img src="http://i31.tinypic.com/e067iv.jpg" />'),
            'Avowed' => array(300, 499, '<img src="http://i28.tinypic.com/2uff2bp.jpg.png" />'),
            'Popular' => array(500, 999, '<img src="http://i27.tinypic.com/2q82exw.jpg" />'),
            'Hailed' => array(1000, 1499, '<img src="http://i30.tinypic.com/2w32pte.jpg" />'),
            'Acclaimed' => array(1500, 1999, '<img src="http://i26.tinypic.com/282fhc2.jpg" />'),
            'Hero' => array(2000, 4999, '<img src="http://i27.tinypic.com/jrthsk.jpg" />'),
            'Legend' => array(5000, null, '<img src="http://i27.tinypic.com/2vwvjoy.jpg" />'),

        );
        foreach($ranks as $rank => $values)
        {
            if($values[0] == null)
            {
                if($rep <= $values[1])
                {
                    return array($rank, $values[2]);
                }
            }
            elseif($values[1] == null)
            {
                if($rep >= $values[0])
                {
                    return array($rank, $values[2]);
                }
            }
            else
            {
                if($rep >= $values[0] and $rep <= $values[1])
                {
                    return array($rank, $values[2]);
                }
            }
        }
    }

Add @ htdocs/index.php:
PHP:
    case "rep";
          $topic = "Reputation";
          $subtopic = "rep";
          include("rep.php");
    break;


You do the layout config to make it appear in your AAC index list
:peace:

NOTE! If the two big stripes @ Reputation Highscores page are not shown, then
-> Replace this upper part of htdocs/config-and-functions.php:
PHP:
// ###################### CONFIG ########################
//load page config file
$config['site'] = parse_ini_file('config/config.ini');
include('config/config.php');
//check install
if($config['site']['install'] != "no")
{
    header("Location: install.php");
    exit;
}
//load server config
$config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');
if(isset($config['server']['mysqlHost']))
{
    //new (0.2.6+) ots config_serv2.lua file
    $mysqlhost = $config['server']['mysqlHost'];
    $mysqluser = $config['server']['mysqlUser'];
    $mysqlpass = $config['server']['mysqlPass'];
    $mysqldatabase = $config['server']['mysqlDatabase'];
}
elseif(isset($config['server']['sqlHost']))
{
    //old (0.2.4) ots config_serv2.lua file
    $mysqlhost = $config['server']['sqlHost'];
    $mysqluser = $config['server']['sqlUser'];
    $mysqlpass = $config['server']['sqlPass'];
    $mysqldatabase = $config['server']['sqlDatabase'];
}
$sqlitefile = $config['server']['sqliteDatabase'];
$passwordency = '';
if(strtolower($config['server']['useMD5Passwords']) == 'yes' || strtolower($config['server']['passwordType']) == 'md5')
    $passwordency = 'md5';
if(strtolower($config['server']['passwordType']) == 'sha1')
    $passwordency = 'sha1';
// loads #####POT mainfile#####
include('pot/OTS.php');
// PDO and POT connects to database
$ots = POT::getInstance();
if(strtolower($config['server']['sqlType']) == "mysql")
{
    //connect to MySQL database
    try
    {
        $ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
    }
    catch(PDOException $error)
    {
        echo 'Database error - can\'t connect to MySQL database. Possible reasons:<br>1. MySQL server is not running on host.<br>2. MySQL user, password, database or host isn\'t configured in: <b>'.$config['site']['server_path'].'config_serv2.lua</b> .<br>3. MySQL user, password, database or host is wrong.';
        exit;
    }
}
elseif(strtolower($config['server']['sqlType']) == "sqlite")
{
    //connect to SQLite database
    $link_to_sqlitedatabase = $config['site']['server_path'].$sqlitefile;
    try
    {
        $ots->connect(POT::DB_SQLITE, array('database' => $link_to_sqlitedatabase));
    }
    catch(PDOException $error)
    {
        echo 'Database error - can\'t open SQLite database. Possible reasons:<br><b>'.$link_to_sqlitedatabase.'</b> - file isn\'t valid SQLite database.<br><b>'.$link_to_sqlitedatabase.'</b> - doesn\'t exist.<br><font color="red">Wrong PHP configuration. Default PHP does not work with SQLite databases!</font>';
        exit;
    }
}
else
{
    echo 'Database error. Unknown database type in <b>'.$config['site']['server_path'].'config_serv2.lua</b> . Must be equal to: "<b>mysql</b>" or "<b>sqlite</b>". Now is: "<b>'.strtolower($config['server']['sqlType']).'"</b>';
    exit;
}

$SQL = POT::getInstance()->getDBHandle();
$layout_name = "layouts/".$layout_name = $config['site']['layout'];;
$layout_ini = parse_ini_file($layout_name.'/layout_config.ini');
foreach($layout_ini as $key => $value)
    $config['site'][$key] = $value;

With:
PHP:
// ###################### CONFIG ########################
//load page config file
$config['site'] = parse_ini_file('config/config.ini');
include('config/config.php');
//check install
if($config['site']['install'] != "no")
{
    header("Location: install.php");
    exit;
}
//load server config
$config['server'] = parse_ini_file($config['site']['server_path'].'config.lua');
if(isset($config['server']['mysqlHost']))
{
    //new (0.2.6+) ots config_serv2.lua file
    $mysqlhost = $config['server']['mysqlHost'];
    $mysqluser = $config['server']['mysqlUser'];
    $mysqlpass = $config['server']['mysqlPass'];
    $mysqldatabase = $config['server']['mysqlDatabase'];
}
elseif(isset($config['server']['sqlHost']))
{
    //old (0.2.4) ots config_serv2.lua file
    $mysqlhost = $config['server']['sqlHost'];
    $mysqluser = $config['server']['sqlUser'];
    $mysqlpass = $config['server']['sqlPass'];
    $mysqldatabase = $config['server']['sqlDatabase'];
}
$sqlitefile = $config['server']['sqliteDatabase'];
$passwordency = '';
if(strtolower($config['server']['useMD5Passwords']) == 'yes' || strtolower($config['server']['passwordType']) == 'md5')
    $passwordency = 'md5';
if(strtolower($config['server']['passwordType']) == 'sha1')
    $passwordency = 'sha1';
// loads #####POT mainfile#####
include('pot/OTS.php');
// PDO and POT connects to database
$ots = POT::getInstance();
if(strtolower($config['server']['sqlType']) == "mysql")
{
    //connect to MySQL database
    try
    {
        $ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) );
    }
    catch(PDOException $error)
    {
        echo 'Database error - can\'t connect to MySQL database. Possible reasons:<br>1. MySQL server is not running on host.<br>2. MySQL user, password, database or host isn\'t configured in: <b>'.$config['site']['server_path'].'config_serv2.lua</b> .<br>3. MySQL user, password, database or host is wrong.';
        exit;
    }
}
elseif(strtolower($config['server']['sqlType']) == "sqlite")
{
    //connect to SQLite database
    $link_to_sqlitedatabase = $config['site']['server_path'].$sqlitefile;
    try
    {
        $ots->connect(POT::DB_SQLITE, array('database' => $link_to_sqlitedatabase));
    }
    catch(PDOException $error)
    {
        echo 'Database error - can\'t open SQLite database. Possible reasons:<br><b>'.$link_to_sqlitedatabase.'</b> - file isn\'t valid SQLite database.<br><b>'.$link_to_sqlitedatabase.'</b> - doesn\'t exist.<br><font color="red">Wrong PHP configuration. Default PHP does not work with SQLite databases!</font>';
        exit;
    }
}
else
{
    echo 'Database error. Unknown database type in <b>'.$config['site']['server_path'].'config_serv2.lua</b> . Must be equal to: "<b>mysql</b>" or "<b>sqlite</b>". Now is: "<b>'.strtolower($config['server']['sqlType']).'"</b>';
    exit;
}

$SQL = POT::getInstance()->getDBHandle();
$layout_name = "layouts/".$layout_name = $config['site']['layout'];;
$layout_ini = parse_ini_file($layout_name.'/layout_config.ini');
foreach($layout_ini as $key => $value)
    $config['site'][$key] = $value;
 
Last edited:
omg, u are the king :d
:p not yet but I'll fix this cool system as its 0.2 edition
it's just a project many players and friends asked me to do, also they pay me money to buy rep :D they love to show off their rep outfits
 
I got this error msg
[25/10/2009 10:52:05] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/rep/repKill.lua)
[25/10/2009 10:52:05] data/creaturescripts/scripts/rep/repKill.lua:2: '<eof>' expected near 'end'
 
@up: you didn't copy the script well, check it out again
 
Last edited:
pretty great idea!
i'll wait alittle bit before adding it in and testing it myself
 
Not Work on TFS 0.3.4pl2
The monsters not die! Bug on Death. ;x

;@

Sorry for my bad english.
 
@up: ok, fixing it...
edit1: right, the problem is in repKill, I'm on it...
edit2: try it now :) replace repKill.lua for the new one I posted, main thread
edit3: keep looking for bugs :) the sys is almost perfect
 
Last edited:
Not Work on TFS 0.3.4pl2
The monsters not die! Bug on Death. ;x

;@

Sorry for my bad english.


I am having the same problem.
But my distro is 0.3.5.

And there's another error, when I use the / fuck, it does not work.Only if have positive points (/hail).

Sorry for my bad english.
 
@up yep I know :) I tested the scripts, hum did you follow the tutorial from A to Z?
if so, I updated some scripts last night, and I suggest you to do the same, then report me if you another bug
your problem is in the outdated functions and creatureventsu got, I added a fix for all'em in the main thread
 
Last edited:
its work for tfs 0.3.4 cd?

yes, ought to work for all 0.3s, post bugs if you find one and I'll fix it ;) don't worry this system will be perfect
 
Uve made a slightly wrong typoe, when i had to make command, i had to make /hail 50,xxxx not /hail xxxx,50 ;/
 
Uve made a slightly wrong typoe, when i had to make command, i had to make /hail 50,xxxx not /hail xxxx,50 ;/
:pyep, the problem is that I imported the scripts from a 0.2 scripts but I recently realized now about that matter, I'll fix it later so keep checking the post;) the other scripts seem to be ok
--u can also edit the rep of a player in SQL phpmyadmin/sqlite
 
Last edited:
:) good good good
I just need to fix addremove.lua(/hail, /fuck, /set --gm commands--)
and check skull killed players and this will be done :D
updated and fixed@100%: functions.lua/hail.lua/fuck.lua/info.lua
you should update yours if you are using an older version of them
-now player can see the exact time he can fuck/hail another player
 
yay thanks, I'll make the system even better with time :)
I hope many distros use this
I'll add downloadable scripts soon :D
 
Last edited:
Status
Not open for further replies.
Back
Top