MKZ Posted April 30, 2022 Share Posted April 30, 2022 esse e meu codigo: function Exit_Veh (thePed) if ( getElementModel ( source ) == 448 ) then if (Moto[thePed]) and isElement(Moto[thePed]) then exports.Scripts_dxInfo:dxInfoAddBox(thePed, "INFO : Você tem 1 minutos e meio para voltar pra van", "error") Tempo[thePed] = setTimer ( function(thePed) if isElement( Object_Pizza[thePed] ) then destroyElement( Object_Pizza[thePed] ) end if isElement( Marker_Entregar[thePed] ) then destroyElement( Marker_Entregar[thePed] ) end if isElement( Blip_Entregar[thePed] ) then destroyElement( Blip_Entregar[thePed] ) end if isElement( Marker_Moto[thePed] ) then destroyElement( Marker_Moto[thePed] ) end if isElement(Moto[thePed]) then destroyElement(Moto[thePed]) end removeCommandHandler("pizza", Pegar_Pizza_Object) setElementData(thePed, "Entrega_Acionada", false) setElementData(thePed, "DNL:Entregar_Pizzas", false) setElementData( thePed, "DNL:Pizza", 0 ) exports.Scripts_dxInfo:dxInfoAddBox(thePed, "INFO : Sua moto foi destruida e seu emprego foi encerrado", "error") end, 30000, 1 ) end end end addEventHandler ("onVehicleExit", root, Exit_Veh) function Enter_Veh (thePed) if (Moto[thePed]) and isElement(Moto[thePed]) then if isTimer(Tempo[thePed]) then killTimer(Tempo[thePed]) end end end addEventHandler ("onVehicleEnter", root, Enter_Veh) o setelementdata fica dando error no debug e a moto nao sumi e nao aparece a mensagem que a moto foi destruida Link to comment
carlinloko Posted May 1, 2022 Share Posted May 1, 2022 function Exit_Veh (thePed) if ( getElementModel ( source ) == 448 ) then if (Moto[thePed]) and isElement(Moto[thePed]) then exports.Scripts_dxInfo:dxInfoAddBox(thePed, "INFO : Você tem 1 minutos e meio para voltar pra van", "error") Tempo[thePed] = setTimer ( function(thePed) if isElement( Object_Pizza[thePed] ) then destroyElement( Object_Pizza[thePed] ) end if isElement( Marker_Entregar[thePed] ) then destroyElement( Marker_Entregar[thePed] ) end if isElement( Blip_Entregar[thePed] ) then destroyElement( Blip_Entregar[thePed] ) end if isElement( Marker_Moto[thePed] ) then destroyElement( Marker_Moto[thePed] ) end if isElement(Moto[thePed]) then destroyElement(Moto[thePed]) end removeCommandHandler("pizza", Pegar_Pizza_Object) setElementData(thePed, "Entrega_Acionada", false) setElementData(thePed, "DNL:Entregar_Pizzas", false) setElementData( thePed, "DNL:Pizza", 0 ) exports.Scripts_dxInfo:dxInfoAddBox(thePed, "INFO : Sua moto foi destruida e seu emprego foi encerrado", "error") end, 30000, 1, thePed ) end end end addEventHandler ("onVehicleExit", root, Exit_Veh) function Enter_Veh (thePed) if (Moto[thePed]) and isElement(Moto[thePed]) then if isTimer(Tempo[thePed]) then killTimer(Tempo[thePed]) end end end addEventHandler ("onVehicleEnter", root, Enter_Veh) 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