Big Smoker Posted July 13, 2019 Posted July 13, 2019 (edited) Boa noite preciso de uma ajuda para uma função para ver os meus veículos que são salvos, ai tem um setElementData que seta quando inicia o servidor. o que é isso? AVISO = mau argumento @ 'getElementData' [elemento esperado no argumento 1, booleano] -- Cliente playerBlibs = {} setTimer(function() if getElementData(getLocalPlayer(),"logedin") then for i, blip in pairs(playerBlibs) do if isElement(blip)then destroyElement(blip) end end for i,veh in ipairs(getElementsByType("vehicle")) do if veh then vehicles = tonumber(getElementData(getElementData(veh,"parent"),"dropVeh")) -- aviso if vehicles == 2 then playerBlibs[i] = createBlipAttachedTo(veh,0,2,244, 32, 32) setBlipVisibleDistance(playerBlibs[i],1000) end end end end end,10000,0) Edited July 13, 2019 by felipebaidoloko
#DeltaSCR Posted July 13, 2019 Posted July 13, 2019 Isso é server-side ou client-side? Minha resposta te ajudou? Por favor, não esqueça de avaliar - #DeltaSCR Minha página no Facebook: Delta Scripting - MTA "Viribus et honor"
#DeltaSCR Posted July 13, 2019 Posted July 13, 2019 Aliás, você está falando da linha 11 certo? Minha resposta te ajudou? Por favor, não esqueça de avaliar - #DeltaSCR Minha página no Facebook: Delta Scripting - MTA "Viribus et honor"
DNL291 Posted July 13, 2019 Posted July 13, 2019 playerBlibs = {} setTimer(function() if getElementData(getLocalPlayer(),"logedin") then for i, blip in pairs(playerBlibs) do if isElement(blip)then destroyElement(blip) end end for i,veh in ipairs(getElementsByType("vehicle")) do local vehParent = getElementData(veh,"parent") if veh and vehParent then vehicles = tonumber(vehParent) -- aviso if vehicles == 2 then playerBlibs[i] = createBlipAttachedTo(veh,0,2,244, 32, 32) setBlipVisibleDistance(playerBlibs[i],1000) end end end end end,1000,0) Essa verificação vai evitar o aviso no debug, mas se algo tiver errado é com a data "parent". 1 Please do not PM me with scripting related question nor support, use the forums instead.
Big Smoker Posted July 13, 2019 Author Posted July 13, 2019 Deu certo! so coloquei a função e deu certo com o setElementData que eu fiz muito obrigado
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