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

Request ;Ingame Highscore!

Henkos

New Member
Joined
Jun 29, 2008
Messages
2,989
Reaction score
4
Hello. I need a script for my 0.3.4 server. So if you say !highscore "sword" you'll see who's on highscore Or something.
Also say where i should place it XD
I also want some script so an message in red/white will keep reapting each 30 minutes,(I can change the message)
Repp!
 
Code:
local displayoutput = {"Level","Magic Level","Fist Fighting","Club Fighting","Sword Fighting","Axe Fighting","Distance Fighting","Shielding","Fishing"}

local itemtype = {9969,9933,5896,8929,8932,7388,8849,8906,2580}

function onSay(cid, words, param)
    number = 1
    param = string.lower(param)
    skilllist = ""
    command = TRUE
    if param == "level" then        
        display = 1
    elseif param == "magic" then
        display = 2
    elseif param == "fist" then
        id = 0
        display = 3
    elseif param == "club" then
        id = 1
        display = 4
    elseif param == "sword" then
        id = 2
        display = 5
    elseif param == "axe" then
        id = 3
        display = 6
    elseif param == "distance" then
        id = 4
        display = 7
    elseif param == "shield" then
        id = 5
        display = 8
    elseif param == "fish" then
        display = 9
        id = 6
    else 
        error = 'Highscore Commands:\n\n!highscores level\n!highscores magic\n!highscores fist\n!highscores club\n!highscores sword\n!highscores axe\n!highscores distance\n!highscores shield\n!highscores fish'

        doShowTextDialog(cid, 5958, error)
        command = FALSE

    end

    if command ~= FALSE then
        if display == 1 then
            local player = db.getResult("SELECT `name`, `level` FROM `players` WHERE group_id < '2' ORDER BY `level` DESC LIMIT 50;")    
            if(player:getID() ~= -1) then
                while (true) do
                    local name = player:getDataString("name")
                    local level = player:getDataInt("level")

                      skilllist = skilllist.. "\n#"..string.format("%5s",number.."   "..name.."  -  "..level)
                    number = number + 1
                    if not(player:next()) then
                        break
                    end
                end
                player:free()
            end
        elseif display == 2 then
            local player = db.getResult("SELECT `name`, `maglevel` FROM `players` WHERE group_id < '2' ORDER BY `maglevel` DESC LIMIT 50;")
            if(player:getID() ~= -1) then    
                while (true) do
                    local name = player:getDataString("name")
                    local maglevel = player:getDataInt("maglevel")

                      skilllist = skilllist.. "\n#"..string.format("%5s",number.."   "..name.."  -  "..maglevel)
                    if not(player:next()) then
                        break
                    end
                    number = number + 1
                end
            end
            player:free()
        else
            local skills = db.getResult("SELECT `player_id`, `value`, `skillid` FROM `player_skills` WHERE `skillid` = "..id.." ORDER BY `value` DESC;")
            while (true) do
                local GUID = skills:getDataInt("player_id")
                local value = skills:getDataInt("value")
                local skillid = skills:getDataInt("skillid")
                local player = db.getResult("SELECT `name` FROM `players` WHERE `id` = "..GUID.." and group_id < '2' ")
                if(player:getID() ~= -1) then
                    local name = player:getDataString("name")
                      skilllist = skilllist.. "\n#"..string.format("%5s",number.."   "..name.."  -  "..value)
                    number = number + 1
                    player:free()
                end
                if number > 50 then
                    break
                end
                    if not(skills:next()) then
                    break
                end
            end
            skills:free()
        end
        dialog = ""..displayoutput[display].." Highscores: \n  "..skilllist..""
        doShowTextDialog(cid, itemtype[display], dialog)
    end    
end
 
There are many of these released here on OTland.
Surely you are not retarded?

Simply use the "Search Function."
 
Code:
local displayoutput = {"Level","Magic Level","Fist Fighting","Club Fighting","Sword Fighting","Axe Fighting","Distance Fighting","Shielding","Fishing"}

local itemtype = {9969,9933,5896,8929,8932,7388,8849,8906,2580}

function onSay(cid, words, param)
    number = 1
    param = string.lower(param)
    skilllist = ""
    command = TRUE
    if param == "level" then        
        display = 1
    elseif param == "magic" then
        display = 2
    elseif param == "fist" then
        id = 0
        display = 3
    elseif param == "club" then
        id = 1
        display = 4
    elseif param == "sword" then
        id = 2
        display = 5
    elseif param == "axe" then
        id = 3
        display = 6
    elseif param == "distance" then
        id = 4
        display = 7
    elseif param == "shield" then
        id = 5
        display = 8
    elseif param == "fish" then
        display = 9
        id = 6
    else 
        error = 'Highscore Commands:\n\n!highscores level\n!highscores magic\n!highscores fist\n!highscores club\n!highscores sword\n!highscores axe\n!highscores distance\n!highscores shield\n!highscores fish'

        doShowTextDialog(cid, 5958, error)
        command = FALSE

    end

    if command ~= FALSE then
        if display == 1 then
            local player = db.getResult("SELECT `name`, `level` FROM `players` WHERE group_id < '2' ORDER BY `level` DESC LIMIT 50;")    
            if(player:getID() ~= -1) then
                while (true) do
                    local name = player:getDataString("name")
                    local level = player:getDataInt("level")

                      skilllist = skilllist.. "\n#"..string.format("%5s",number.."   "..name.."  -  "..level)
                    number = number + 1
                    if not(player:next()) then
                        break
                    end
                end
                player:free()
            end
        elseif display == 2 then
            local player = db.getResult("SELECT `name`, `maglevel` FROM `players` WHERE group_id < '2' ORDER BY `maglevel` DESC LIMIT 50;")
            if(player:getID() ~= -1) then    
                while (true) do
                    local name = player:getDataString("name")
                    local maglevel = player:getDataInt("maglevel")

                      skilllist = skilllist.. "\n#"..string.format("%5s",number.."   "..name.."  -  "..maglevel)
                    if not(player:next()) then
                        break
                    end
                    number = number + 1
                end
            end
            player:free()
        else
            local skills = db.getResult("SELECT `player_id`, `value`, `skillid` FROM `player_skills` WHERE `skillid` = "..id.." ORDER BY `value` DESC;")
            while (true) do
                local GUID = skills:getDataInt("player_id")
                local value = skills:getDataInt("value")
                local skillid = skills:getDataInt("skillid")
                local player = db.getResult("SELECT `name` FROM `players` WHERE `id` = "..GUID.." and group_id < '2' ")
                if(player:getID() ~= -1) then
                    local name = player:getDataString("name")
                      skilllist = skilllist.. "\n#"..string.format("%5s",number.."   "..name.."  -  "..value)
                    number = number + 1
                    player:free()
                end
                if number > 50 then
                    break
                end
                    if not(skills:next()) then
                    break
                end
            end
            skills:free()
        end
        dialog = ""..displayoutput[display].." Highscores: \n  "..skilllist..""
        doShowTextDialog(cid, itemtype[display], dialog)
    end    
end

Thanks.. where shall i place it :S?
 
LUA:
function onSay(cid, words, param)
    if(param == "exp") or (param == "") then
doPlayerPopupFYI(cid, getHighscoreString(8))
    elseif(param == "magic") or (param == "ml") then
doPlayerPopupFYI(cid, getHighscoreString(7))
    elseif(param == "fishing") or (param == "fish") then
doPlayerPopupFYI(cid, getHighscoreString(6))
    elseif(param == "shielding") or (param == "shield") then
doPlayerPopupFYI(cid, getHighscoreString(5))
    elseif(param == "distance") or (param == "dist") then
doPlayerPopupFYI(cid, getHighscoreString(4))
    elseif(param == "sword") then
doPlayerPopupFYI(cid, getHighscoreString(2))
    elseif(param == "axe") then
doPlayerPopupFYI(cid, getHighscoreString(3))
    elseif(param == "club") then
doPlayerPopupFYI(cid, getHighscoreString(1))
    elseif(param == "fist") then
doPlayerPopupFYI(cid, getHighscoreString(0))
    end
    return TRUE
end

<talkaction access="0" words="!rank" event="script" value="YOURNAMESCRIPT.lua"/>

to use -> !rank magic
 
How shall i import it :(?

1.Go to your servers folder
2.Go to talkactions\scripts
3.Copy a random .lua file which is in there
4.Open the .lua file which you copied
5.Delete everything in the script that you copied
6.Copy the script that they gave you in the fileee which you deleted everything
7.Save it.
8.Go to talkactions
9.Copy the rows as they gave you.
10.Open up your talkactions.xml
11.Copy the rows into talkactions.xml

edit:
too late
 
1.Go to your servers folder
2.Go to talkactions\scripts
3.Copy a random .lua file which is in there
4.Open the .lua file which you copied
5.Delete everything in the script that you copied
6.Copy the script that they gave you in the fileee which you deleted everything
7.Save it.
8.Go to talkactions
9.Copy the rows as they gave you.
10.Open up your talkactions.xml
11.Copy the rows into talkactions.xml

edit:
too late
Thanks ! But How do i raise the mane rate? When not promoted, And when promoted :S?
 
Back
Top