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

Look player Frag REP +

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
1° i would like whenlook player show many frags the player has

Example:

Code:
01:14 You see Sir Micky Engel (Level 113). He is a royal paladin,Has x Frags

2° a simple command !highscore of frags.

Example:

- Frags - Name
- xxx - MraZ

Thx
 
Last edited:
ok put that in creature scripte.xml creat new lua and paste
LUA:
local 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 onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) then
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and ".\nShe" or ".\nHe") .." has "..getPlayerFrags(thing.uid).." frags")
return true
end
end

in the creature.xml paste this
Code:
<event type="look" name="lol" event="script" value="name of script.lua"/>

and in creaturescrpit-->login paste this before last return true

LUA:
 registerCreatureEvent(cid, "lol")

This when you look on other players not when you lokk on your self
example:
"royal" kills you.
You look on royal
"you see royale,blblblblbllblblbl.he has 1 frags.


--Credites to cyko for this
this is mod
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Kill Rank" enabled="yes">
    <config name="killrank_config"><![CDATA[
        limit = 10
    ]]></config>
    <talkaction words="!rankkill" event="buffer"><![CDATA[
        domodlib('killrank_config')
        local t, ret = {}, "Top " .. math.min(limit, getWorldCreatures(0)) .. " fraggers online:"
        for _, cid in ipairs(getPlayersOnline()) do
            table.insert(t, {cid, db.getResult("SELECT COUNT(*) as count FROM killers WHERE death_id IN (SELECT kill_id FROM player_killers) AND " .. getPlayerGUID(cid) .. " IN (SELECT player_id FROM player_killers WHERE kill_id = death_id)"):getDataInt("count")})
        end
        table.sort(t, function(a,b) return a[2] > b[2] end)
        for i = 1, math.min(#t, limit)  do
            ret = ret .. "\n" .. i .. ". " .. getPlayerName(t[i][1]) .. " - " .. t[i][2] .. " frags"
        end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ret)
    ]]></talkaction>
</mod
 
Back
Top