antiblock
https://i.imgur.com/aJ17bf7.gif
  • Chatbox

    You don't have permission to chat.
    Load More
Sign in to follow this  
NewWars

[Function]Obter Proximo Index De Uma Table

8 posts in this topic

Boas Pessoal.


 


Como sempre, menos string, mais objectividade(palavras do governo xD)


 


Esta função serve para obter o proximo index de uma table, é util para quem usa index da table como level ou assim do genero...


 


Ca vai:



function GetNextIndex(gTable, realIndex)
keysTbl = {}
for k, v in pairs(gTable) do
table.insert(keysTbl, k)
end

table.sort(keysTbl)

for i = 1, #(keysTbl) do
if keysTbl[i] == realIndex then
return keysTbl[i+1] or 0
end
end

return 0
end

Cumprimentos.


Share this post


Link to post
Share on other sites
antiblock
https://i.imgur.com/aJ17bf7.gif

Faz um sistema de lojas offline ou o sistemas de faixas <.<

Share this post


Link to post
Share on other sites

O NovaGuerras é um gajo simpático

Share this post


Link to post
Share on other sites

O NovaGuerras é um gajo simpático

Simpatico ou não, sabes que não tenho sistemas oficiais nem pubs, e o que tenho meu e posso partilhar, eu venho aqui e partilho.

 

 

Cumprimentos.

Share this post


Link to post
Share on other sites

Faz um sistema de lojas offline ou o sistemas de faixas <.<

Ele não é capaz.

 

shots fired :trollface: 

Share this post


Link to post
Share on other sites

Tens a func mal escrita. Não é. #(table) é #table. Coisa q só funciona em lua 5.x, x>1. Lua do metin é 5.0, logo deves usar table.getn(table).

Share this post


Link to post
Share on other sites

Para que serve ? já agora bom post obrigado 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this