JonhAfrei179 Posted August 24, 2019 Posted August 24, 2019 (edited) rapaziada Vê se vcs conseguem me ajudar no seguinte ... eu tenho um script de loja de armas com porte ... esse porte funciona com base no getElementData porem toda vez que o jogador sai do servidor e entra de novo ele perde o porte .. Tem alguma maneira de salvar essa porte na conta dele ? Edited August 24, 2019 by JonhAfrei179
Tommy. Posted August 24, 2019 Posted August 24, 2019 usa: getElementData setElementData getAccountData setAccountData Quando o jogador sair você usa o getElementData e setAccountData Quando o jogar logar você usa o getAccountData e setElementData DID I HELP YOU? ________________________________________________________________________ ム MY STEAM ________________________________________________________________________ MY SITE www.tommy.br.com
JonhAfrei179 Posted August 24, 2019 Author Posted August 24, 2019 2 hours ago, Tommy. said: usa: getElementData setElementData getAccountData setAccountData Quando o jogador sair você usa o getElementData e setAccountData Quando o jogar logar você usa o getAccountData e setElementData Int ficaria algo parecido com isso ? funtion aPorte (player) if getElementData( player, "porte" ) == false then setAccountData( player, "porte", true outputChatBox("texto" end end addEventHandler("onMarkerHit", Mporte, aPorte )
Moderators Lord Henry Posted August 24, 2019 Moderators Posted August 24, 2019 (edited) Não. Está errado. Faça assim: funtion aPorte (hitElement) if (hitElement and getElementType (hitElement) == "player") then local account = getPlayerAccount (hitElement) if (isGuestAccount (account)) then return end if (getElementData (hitElement, "porte")) then setAccountData (account, "porte", getElementData (hitElement, "porte")) outputChatBox ("Dados salvos na conta.", hitElement) else outputChatBox ("Não há dados para serem salvos na conta.", hitElement) end end end addEventHandler ("onMarkerHit", Mporte, aPorte) Edited August 24, 2019 by Lord Henry Corrigida a indentação. 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.
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