• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Merging onLook scripts (Cyber's Rep System+ Frag Look)

Status
Not open for further replies.

luigilc

Lua Learner
Joined
Mar 24, 2010
Messages
863
Reaction score
37
Location
A music box
I want to know how I can merge 2 onLook scripts...
Cyber's rep system mod and this script:
LUA:
--Script By Theax :)
function getPlayerFrags(cid)
    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}
 
    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {date = result:getDataInt("date")}
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end
 
    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    } 
    return size.day + size.week + size.month
end 
 
function onLogin(cid)
    registerCreatureEvent(cid, "fraglook")
    return true
end
 
function onLook(cid, thing, position, lookDistance)
    if isPlayer(thing.uid) and thing.uid ~= cid then
        doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']')
        return true
    elseif thing.uid == cid then
        doPlayerSetSpecialDescription(cid,'[Frags: '..getPlayerFrags(cid)..']')
        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..getPlayerSpecialDescription(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
wich is not a mod
 
This is how I conjoined scripts

XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Talkactions" version="1.0" author="Sepultra" contact="Fu Manchu" enabled="yes">
	-- Custom Commands --
	<talkaction log="no" access="0" words="!aol" event="script"><![CDATA[
function onSay(cid, words, param)
	if doPlayerRemoveMoney(cid, 10000) == true then
		doPlayerAddItem(cid, 2173, 1) ; 
		doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_BLUE) ; 
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've bought an amulet of loss!") ; 
	else
		doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) ; 
		return doPlayerSendCancel(cid, "You don't have enough money.") ; 
	end ; return true ; 
end ; 
	]]></talkaction>
	<talkaction log="no" access="0" words="!bp;!BP;!Bp;!bP" event="script"><![CDATA[
function onSay(cid, words, param)
	if doPlayerRemoveMoney(cid, 1000) == true then
		doPlayerAddItem(cid, 1988, 1) ; 
		doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN) ; 
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You've bought a BackPack!") ; 
	else
		doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) ; 
		return doPlayerSendCancel(cid, "You don't have enough money.") ; 
	end ; return true ; 
end ;
	]]></talkaction>
	<talkaction log="no" access="0" words="!bless" event="script"><![CDATA[
function onSay(cid, words, param, channel)
	local blessings, cost = { 1, 2, 3, 4, 5 }, 50000 ; 
	for i = 1, #blessings do
		if(getPlayerBlessing(cid, blessings[i])) then
			doPlayerSendCancel(cid, "You already have been blessed by God Sepultra.") ;
			doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) ; 
		elseif(getPlayerMoney(cid) < cost) then
			doPlayerSendCancel(cid, "You do not have enough money.") ; 
			doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF) ; 
		else
			doPlayerAddBlessing(cid, blessings[i]) ; 
			doPlayerRemoveMoney(cid, cost) ; 
			doSendMagicEffect(getThingPosition(cid), 39) ; 
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have recived all 5 blessings from God Sepultra.") ; 
		end
		return true
	end
end 
	]]></talkaction>
	<talkaction log="yes" access="0" words="!spells" event="script"><![CDATA[
	function onSay(cid, words, param, channel)
	local t, k = {}, getPlayerLevel(cid)
	for i = 0, getPlayerInstantSpellCount(cid) - 1 do
		local spell = getPlayerInstantSpellInfo(cid, i)
		if(spell.level ~= 0 and k >= spell.level) then
			if(spell.manapercent > 0) then
				spell.mana = spell.manapercent .. "%"
			end
 
			table.insert(t, spell)
		end
	end
 
	table.sort(t, function(a, b) return a.level < b.level end)
	local text, prevLevel = "", -1
	for i, spell in ipairs(t) do
		local line = ""
		if(prevLevel ~= spell.level) then
			if(i ~= 1) then
				line = "\n"
			end
 
			line = line .. "Spells for Level " .. spell.level .. "\n"
			prevLevel = spell.level
		end
 
		text = text .. line .. "  " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
	end ;
 
	doShowTextDialog(cid, 2175, text) 
	return true 
end 
	]]></talkaction>
</mod>
 
give me the 2 files your trying to conjoin also those are 3 scripts put into one. There is a bless script aol script and a buy bp script all in one mod folder
 
already told you, I'm trying to merge these 2:
1. Cyber's Rep System (MOD):
LUA:
<?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 = 20, --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 = 1, --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, 	'Civilian (======|======)'},
                {300, 	'Popular (=======|=====)'},
                {500, 	'Famous (========|====)'},
                {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] = 150,
        [SKULL_RED] = 300,
        [SKULL_BLACK] = 500,
        [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 getTileInfo(getThingPos(cid)).pvp 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, 50, 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, 50, 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','rank+','+'}, 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','rank-','-'}, 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>
2. Frag onLook (non MOD)
LUA:
--Script By Theax :)
function getPlayerFrags(cid)
    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}
 
    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {date = result:getDataInt("date")}
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end
 
    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    } 
    return size.day + size.week + size.month
end 
 
function onLogin(cid)
    registerCreatureEvent(cid, "fraglook")
    return true
end
 
function onLook(cid, thing, position, lookDistance)
    if isPlayer(thing.uid) and thing.uid ~= cid then
        doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']')
        return true
    elseif thing.uid == cid then
        doPlayerSetSpecialDescription(cid,'[Frags: '..getPlayerFrags(cid)..']')
        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..getPlayerSpecialDescription(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
 
try now

LUA:
<?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 = 20, --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 = 1, --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, 	'Civilian (======|======)'},
                {300, 	'Popular (=======|=====)'},
                {500, 	'Famous (========|====)'},
                {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] = 150,
        [SKULL_RED] = 300,
        [SKULL_BLACK] = 500,
        [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 getTileInfo(getThingPos(cid)).pvp 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, 50, 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, 50, 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','rank+','+'}, 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','rank-','-'}, 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>
<event type="FragonLook" name="FragonLook" event="script"><![CDATA[
    function getPlayerFrags(cid)
    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}
 
    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {date = result:getDataInt("date")}
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end
 
    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    } 
    return size.day + size.week + size.month
end 
 
function onLogin(cid)
    registerCreatureEvent(cid, "fraglook")
    return true
end
 
function onLook(cid, thing, position, lookDistance)
    if isPlayer(thing.uid) and thing.uid ~= cid then
        doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']')
        return true
    elseif thing.uid == cid then
        doPlayerSetSpecialDescription(cid,'[Frags: '..getPlayerFrags(cid)..']')
        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..getPlayerSpecialDescription(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>
</mod>
 
Cyber's rep system is 100% functional and for me, it's perfect, so is the frag look, the thing is that I think that you can only have 1 look function at a time cuz you have only 1 special description so I'd have to merge both scripts but I really have no idea how to do that
 
edit1
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 = 20, --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 = 1, --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
 
		function getPlayerFrags(cid)
			local time = os.time()
			local times = {today = (time - 86400), week = (time - (7 * 86400))}
		 
			local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
			if(result:getID() ~= -1) then
				repeat
					local content = {date = result:getDataInt("date")}
					if(content.date > times.today) then
						table.insert(contents.day, content)
					elseif(content.date > times.week) then
						table.insert(contents.week, content)
					else
						table.insert(contents.month, content)
					end
				until not result:next()
				result:free()
			end
		 
			local size = {
				day = table.maxn(contents.day),
				week = table.maxn(contents.week),
				month = table.maxn(contents.month)
			} 
			return size.day + size.week + size.month
		end,
		
		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, 	'Civilian (======|======)'},
                {300, 	'Popular (=======|=====)'},
                {500, 	'Famous (========|====)'},
                {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)) ..'. [Frags: '..getPlayerFrags(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)) ..'. [Frags: '..getPlayerFrags(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] = 150,
        [SKULL_RED] = 300,
        [SKULL_BLACK] = 500,
        [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 getTileInfo(getThingPos(cid)).pvp 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, 50, 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, 50, 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','rank+','+'}, 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','rank-','-'}, 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>

getPlayerFrags function is taken from tfs, idk why ppl credit themselves like if they created it
 
got an error:
LUA:
[03/09/2011 21:15:37] [Error - CreatureScript Interface] 
[03/09/2011 21:15:37] buffer
[03/09/2011 21:15:37] Description: 
[03/09/2011 21:15:37] [string "rep = {..."]:16: '(' expected near 'getPlayerFrags'
 
edit2
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 = 20, --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 = 1, --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
 
        getPlayerFrags = function(cid) 
            local time = os.time()
            local times = {today = (time - 86400), week = (time - (7 * 86400))}
 
            local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
            if(result:getID() ~= -1) then
                repeat
                    local content = {date = result:getDataInt("date")}
                    if(content.date > times.today) then
                        table.insert(contents.day, content)
                    elseif(content.date > times.week) then
                        table.insert(contents.week, content)
                    else
                        table.insert(contents.month, content)
                    end
                until not result:next()
                result:free()
            end
 
            local size = {
                day = table.maxn(contents.day),
                week = table.maxn(contents.week),
                month = table.maxn(contents.month)
            } 
            return size.day + size.week + size.month
        end,
 
        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,     'Civilian (======|======)'},
                {300,     'Popular (=======|=====)'},
                {500,     'Famous (========|====)'},
                {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)) ..'. [Frags: '..rep.getPlayerFrags(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)) ..'. [Frags: '..rep.getPlayerFrags(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] = 150,
        [SKULL_RED] = 300,
        [SKULL_BLACK] = 500,
        [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 getTileInfo(getThingPos(cid)).pvp 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, 50, 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, 50, 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','rank+','+'}, 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','rank-','-'}, 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>
 
Status
Not open for further replies.
Back
Top