Look, i don't speak english, but i understand some parts.
test:
function getTop()
local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `id` > 6 AND `group_id` < 2 ORDER BY `level` DESC, `name` ASC;")
if (query:getID() ~= -1) then
return {query:getDataString("name"),query:getDataInt("level")}
end
return false
end
function onLogin(cid)
local x = {
[0] = {lookType = 136, lookHead = 78, lookBody = 69, lookLegs = 58, lookFeet = 76, lookAddons = 0}, -- Outfit female
[1] = {lookType = 128, lookHead = 78, lookBody = 69, lookLegs = 58, lookFeet = 76, lookAddons = 0} -- Outfit Male
}
if getTop()[1] == getCreatureName(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "For being the highest player on the server, you receive benefits of special outfit")
doCreatureChangeOutfit(cid, x[getPlayerSex(cid)], -1)
end
return true
end



info
Grupo: Campones
Registrado: 15/06/13
Posts: 6
Reputação: 0
Char no Tibia: Dem Shion
On use:
out this text:
I can refer to level I or name of the player in first position?
i want make one CreatureEvent
so that at the first position player give one special outfit.
something like this referring to the name :
local x = { [0] = {lookType = 136, lookHead = 78, lookBody = 69, lookLegs = 58, lookFeet = 76, lookAddons = 0}, -- Outfit female [1] = {lookType = 128, lookHead = 78, lookBody = 69, lookLegs = 58, lookFeet = 76, lookAddons = 0} -- Outfit Male } function onLogin(cid) if getCreatureName(cid) = getHighscoreString(8) and getPlayerStorageValue(cid, 5187) == -1 then ---- here on getHighscoreString(8) Seeking to mention the name of the first position setPlayerStorageValue(cid, 5187, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "for being the highest player on the server, you receive benefits of special outfit") return TRUE end if getCreatureName(cid) = getHighscoreString(8) and getPlayerStorageValue(cid, 5187) == 1 then ---- here on getHighscoreString(8) Seeking to mention the name of the first position doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "for being the highest player on the server, you receive benefits of special outfit") elseif getCreatureName(cid) ~= getHighscoreString(8) and getPlayerStorageValue(cid, 5187) == 1 then ---- here on getHighscoreString(8) Seeking to mention the name of the first position setPlayerStorageValue(cid, 5187, -1) doCreatureChangeOutfit(cid, x[getPlayerSex(cid)]) end return TRUE endsomething like this referring to the LEVEL:
local x = { [0] = {lookType = 136, lookHead = 78, lookBody = 69, lookLegs = 58, lookFeet = 76, lookAddons = 0}, -- Outfit female [1] = {lookType = 128, lookHead = 78, lookBody = 69, lookLegs = 58, lookFeet = 76, lookAddons = 0} -- Outfit Male } function onLogin(cid) if getPlayerLevel(cid) > getHighscoreString(8) and getPlayerStorageValue(cid, 5187) == -1 then ---- here on getHighscoreString(8) Seeking to mention the LEVEL of the first position setPlayerStorageValue(cid, 5187, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "for being the highest player on the server, you receive benefits of special outfit") return TRUE end if getPlayerLevel(cid) > getHighscoreString(8) and getPlayerStorageValue(cid, 5187) == 1 then ---- here on getHighscoreString(8) Seeking to mention the LEVEL of the first position doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "for being the highest player on the server, you receive benefits of special outfit") elseif getPlayerLevel(cid) < getHighscoreString(8) and getPlayerStorageValue(cid, 5187) == 1 then ---- here on getHighscoreString(8) Seeking to mention the LEVEL of the first position setPlayerStorageValue(cid, 5187, -1) doCreatureChangeOutfit(cid, x[getPlayerSex(cid)]) end return TRUE endThanks for your attention, I explain my idea, the idea of this script is that the best player in the server receive a special outfit.