DARKFIRE Posted June 19, 2017 Posted June 19, 2017 como eu faço pra deixar o /prender por id ex: /prender 1 me ajudar pfv How do I leave the / hold for id ex: / hold 1 help me please
Moderators Lord Henry Posted June 24, 2017 Moderators Posted June 24, 2017 (edited) Quando o jogador entra no server, vc pode atribuir um valor ID nele usando setElementData e depois quando você for prender, em vez de pegar o nome do jogador, você pega aquele que possuir essa data com esse ID. Mas já vou logo avisando que isso não é tão fácil de fazer, pois tem que fazer uns esquemas para verificar o ID de todo mundo para não repetir IDs. Edited June 24, 2017 by Lord Henry Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
Gw8 Posted June 24, 2017 Posted June 24, 2017 local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i) break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() ids = {} for k, v in ipairs(getElementsByType("player")) do local id = setElementData(v,"id",k) ids[k] = v end end addEventHandler("onResourceStart",resourceRoot,startup) function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerID ( player ) return getElementData( player, "id") end function getPlayerFromId ( theID ) if theID then local theID = tonumber(theID) local theplayer for index,player in ipairs(getElementsByType("player")) do if getElementData(player ,"id") == theID then theplayer = player end end return theplayer else return false end end sistema de id,mais top que já vi kk sempre uso esse. Não sei quem fez mas Vlw ae! 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now