Big Smoker Posted July 13, 2019 Share 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 Link to comment
#DeltaSCR Posted July 13, 2019 Share Posted July 13, 2019 Isso é server-side ou client-side? Link to comment
Big Smoker Posted July 13, 2019 Author Share Posted July 13, 2019 client esqueci de colocar Link to comment
#DeltaSCR Posted July 13, 2019 Share Posted July 13, 2019 Aliás, você está falando da linha 11 certo? Link to comment
DNL291 Posted July 13, 2019 Share 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 Link to comment
Big Smoker Posted July 13, 2019 Author Share Posted July 13, 2019 Deu certo! so coloquei a função e deu certo com o setElementData que eu fiz muito obrigado Link to comment
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