Ir para conteúdo
  • 0

Topico em Inglês, function getHighscoreString(8)


BennyDz

Pergunta

On use:

 

 doPlayerSendTextMessage(cid,22," " ..getHighscoreString(8) .. " ")

 

out this text:

 

Highscore for level
Rank Level - Player Name
1.  301  -  Hansome
2.  287  -  Kina
3.  241  -  Ola Ke Ase
4.  201  -  Bunker
5.  80  -  Remady
6.  80  -  New Test
7.  80  -  Outfit Test
8.  80  -  Test Speed
9.  80  -  Test Vip
10.  80  -  Insane
11.  1  -  Looking
12.  1  -  God Remady
13.  1  -  Rawn
14.  1  -  Knight Sample
15.  1  -  Paladin Sample
16.  1  -  Druid Sample
17.  1  -  Sorcerer Sample
18.  1  -  Rook Sample
19.  1  -  Account Manager
Last updated on:
Tue Jun 18 19:05:04 2013

 

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
end

 

 

something 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
end

 

 

 

Thanks for your attention, I explain my idea, the idea of ​​this script is that the best player in the server receive a special outfit.

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

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

Link para o comentário
Compartilhar em outros sites

  • 0

No hablo Inglés o Portugués, hablo español y siempre me quedo traductores xD explico en Inglés facilita más porque entonces tradusco en portugués y estoy consiguiendo muchos errores de sintaxis

 

muito obrigado eu trabalhei a função que você fez, agora tento fazer o meu script, você poderia modificar a função de fazer mensão do nível? se em algum futuro ocupar esse papel xD

 

english:

thank you very much I worked the function you did, now try to do my script, you could To Modify the function to do mension of the LEVEL? if at some future occupy that function

 

only exchange this:

return {query:getDataString("name"),query:getDataInt("level")}

For:

return {query:getDataString("level"),query:getDataInt("level")}

 

??

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...