• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Player Information

RunarM

Finally back
Joined
Jul 17, 2008
Messages
1,636
Reaction score
32
Location
Norway/Tromsø
Player Information...

Data/Talkaction/Scripts
Info.lua
Lua:
local vocations = {"None","Sorcerer","Druid","Paladin","Knight","Master Sorcerer","Elder Druid","Royal Paladin","Elite Knight"}
local displayoutput = {"Fist: ","Club: ","Sword: ","Axe: ","Distance: ","Shielding: ","Fishing: "}

function onSay(cid, words, param)
    local player = db.getResult("SELECT `name`, `level`, `maglevel`, `id`, `vocation` FROM `players` WHERE `group_id` < 2 and `name` = '"..param.."'")
    
    if(player:getID() ~= -1) then
        local name = player:getDataString("name")
        local level = player:getDataInt("level")
        local GUID = player:getDataInt("id")
        local vocationid = player:getDataInt("vocation")
        local maglevel = player:getDataInt("maglevel")
        vocation = vocations[vocationid+1]
        heading = "Name:        "..name.."\nLevel:        "..level.."\nVocation:  "..vocation.."\n\n"
        skilllist = "Magic:           "..maglevel.."\n"
        local skills = db.getResult("SELECT `skillid`, `value` FROM `player_skills` WHERE `player_id` = '"..GUID.."'  ")
        if(skills:getID() ~= -1) then
            while(true) do
                local skillid = skills:getDataInt("skillid")
                local value = skills:getDataInt("value")
                skilllist = skilllist..displayoutput[skillid+1].."    "..value.."\n"
                if not(skills:next()) then
                    break
                end
            end
            skills:free()
        end
        final = heading..skilllist
        doShowTextDialog(cid,5958, final)
        player:free()
    else
        doPlayerSendCancel(cid, "Invalid Player Name.")
    end
end

in Talkaction.xml
Code:
	<talkaction words="!info" script="info.lua"/>

Picture ingame:
New.jpg


How to use it:
1. login to your server
2. say !info [PLAYERNAME]
3. then you get info about that player =)


Kind Regards, Runarm.
 
Last edited:
I don't know why you use a result from database when you can use (getPlayerLevel(cid), getCreatureName(cid).. etc)
 
@up and double up

simple, because this works even if the player (param) is offline
 
Back
Top