Duff1995 Posted June 20, 2021 Posted June 20, 2021 function ifPlayerEnterOnMarker(markerHit,matchingDimension) if isElement(markerHit) and matchingDimension then if getElementType(markerHit) == "player" and not isPedInVehicle(markerHit) then if isPedInVehicle(source) then if markerHit == ppcikPOSTES[source] then if (matchingDimension) then if isElement(ppcikPOSTES[source]) then local rname = getElementData(source,"rtnamePostes") or nil if rname == nil then return end destroyElement(ppcikPOSTES[source]) triggerClientEvent(source,"AirNew>JOBEletricista>blips<Client",source,false) local vh = getPedOccupiedVehicle(source) outputChatBox ( "#FF0000/reparar", root, 255, 255, 255, true ) toggleAllControls ( source, false ) setControlState ( source, "handbrake", true ) if atualrotnumberPOSTES[source] <= #rotasPOSTES[rname] then exports.Scripts_Dxmessages:outputDx(source, "Reparando... Aguarde 2 Segundos!", "info") setElementData ( source, "AirNewSCR_LiberarXP", "Sim" ) givePlayerMoney ( source, VALOR_POR_POSTES ) setTimer(gerarrota,2500,1,source) setTimer(function(source) exports.Scripts_Dxmessages:outputDx(source, "Jornais Entregues, Siga Para o Proximo Checkpoint!", "success") end,2500,1,source) elseif atualrotnumberPOSTES[source] == #rotasPOSTES[rname]+1 then setElementData(source,"rtnamePostes",rname) atualrotnumberPOSTES[source] = 1 local rec = pay[rname] givePlayerMoney(source,tonumber(rec)) local vh = getPedOccupiedVehicle(source) setTimer(function(source) exports.Scripts_Dxmessages:outputDx(source, "Você Recebeu um Valor de $"..rec.." Por Finalizar as Entregas de Jornais!", "success") end,2500,1,source) setTimer(function(source) toggleAllControls ( source, true ) end, 2500,1, source ) setTimer(function(source) setControlState ( source, "handbrake", false ) end, 2500,1, source ) setElementData(source,"rtnamePostes",nil) end end end end end end addEventHandler("onPlayerMarkerHit",getRootElement(),ifPlayerEnterOnMarker) Meu código está assim porem não está funcionando como deveria, ( na teoria quando o player fosse fazer a entrega se ele estiver dentro do veiculo ele não consegue entregar, ele tem que sair do carro e ir no marker para ai sim funcionar) agradeço dez de já quem puder dar uma moral aqui
androksi Posted June 20, 2021 Posted June 20, 2021 Olá. Não está detectando pois o evento onPlayerMarkerHit leva o JOGADOR como sendo o source. O parâmetro é o MARKER. Logo, o seu parâmetro markerHit está levando o marker, e não o jogador. Altere o markerHit desta linha para source: if getElementType(markerHit) == "player" and not isPedInVehicle(markerHit) then
Duff1995 Posted June 20, 2021 Author Posted June 20, 2021 3 minutes ago, andr0xy said: ele me retornou no debugscript: erro: 'end' expected (to close 'function' at line 278) near '<eof>' if getElementType(markerHit) == "player" and not isPedInVehicle(markerHit) then
Other Languages Moderators Lord Henry Posted June 20, 2021 Other Languages Moderators Posted June 20, 2021 Está faltando um end para fechar o escopo.
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