MKZ Posted April 24, 2022 Posted April 24, 2022 eu estou tentando fazer um aviso que quando o player sair do carro do sedex mandar uma mensagem falando que "voce tem 5 minutos para voltar pra van" senao iria destruir a van, so que o meu script nao ta indo. Tempo = {} function Exit_Veh (source) if (getElementModel (source) == 413) then if (Carro[source]) and isElement(Carro[source]) then triggerClientEvent(source, "addBox", root, "INFO : Você tem 5 minutos para voltar pra van", "info") Tempo[source] = setTimer ( function() if isElement( Object_Caixa[source] ) then destroyElement( Object_Caixa[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end if isElement( Blip_Entregar[source] ) then destroyElement( Blip_Entregar[source] ) end if isElement( Marker_Van[source] ) then destroyElement( Marker_Van[source] ) end destroyElement (Carro[source]) removeCommandHandler("caixa", Pegar_Caixa_Object) setElementData(source, "Entrega_Acionada", false) setElementData(source, "DNL:Entregar_Cargas", false) setElementData( source, "DNL:Cargas", 0 ) triggerClientEvent(source, "addBox", root, "INFO : Sua van foi destruida e seu emprego foi encerrado", "info") end, 300000, 1 ) end end end addEventHandler ("onVehicleExit", root, Exit_Veh) function Enter_Veh (source) if (Carro[source]) and isElement(Carro[source]) then if isTimer(Tempo[source]) then killTimer(Tempo[source]) end end end addEventHandler ("onVehicleEnter", root, Enter_Veh)
MKZ Posted April 24, 2022 Author Posted April 24, 2022 6 hours ago, MKZ said: eu estou tentando fazer um aviso que quando o player sair do carro do sedex mandar uma mensagem falando que "voce tem 5 minutos para voltar pra van" senao iria destruir a van, so que o meu script nao ta indo. Tempo = {} function Exit_Veh (source) if (getElementModel (source) == 413) then if (Carro[source]) and isElement(Carro[source]) then triggerClientEvent(source, "addBox", root, "INFO : Você tem 5 minutos para voltar pra van", "info") Tempo[source] = setTimer ( function() if isElement( Object_Caixa[source] ) then destroyElement( Object_Caixa[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end if isElement( Blip_Entregar[source] ) then destroyElement( Blip_Entregar[source] ) end if isElement( Marker_Van[source] ) then destroyElement( Marker_Van[source] ) end destroyElement (Carro[source]) removeCommandHandler("caixa", Pegar_Caixa_Object) setElementData(source, "Entrega_Acionada", false) setElementData(source, "DNL:Entregar_Cargas", false) setElementData( source, "DNL:Cargas", 0 ) triggerClientEvent(source, "addBox", root, "INFO : Sua van foi destruida e seu emprego foi encerrado", "info") end, 300000, 1 ) end end end addEventHandler ("onVehicleExit", root, Exit_Veh) function Enter_Veh (source) if (Carro[source]) and isElement(Carro[source]) then if isTimer(Tempo[source]) then killTimer(Tempo[source]) end end end addEventHandler ("onVehicleEnter", root, Enter_Veh) Alguem sabe me dizer oque eu tenho que arrumar no meu script ?
carlinloko Posted April 24, 2022 Posted April 24, 2022 testa ae local Tempo = { } function Exit_Veh ( thePed ) if ( getElementModel ( source ) == 413 ) then if ( Carro[thePed] ) and isElement ( Carro[thePed] ) then triggerClientEvent ( thePed, "addBox", root, "INFO : Você tem 5 minutos para voltar pra van", "info" ) Tempo[thePed] = setTimer ( function ( thePed ) if ( isElement ( Object_Caixa[thePed] ) ) then destroyElement ( Object_Caixa[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_Van[thePed] ) ) then destroyElement ( Marker_Van[thePed] ) end destroyElement ( Carro[thePed] ) removeCommandHandler("caixa", Pegar_Caixa_Object) setElementData ( thePed, "Entrega_Acionada", false ) setElementData ( thePed, "DNL:Entregar_Cargas", false ) setElementData( thePed, "DNL:Cargas", 0 ) triggerClientEvent ( thePed, "addBox", root, "INFO : Sua van foi destruida e seu emprego foi encerrado", "info" ) end, 300000, 1, thePed ) end end end addEventHandler ( "onVehicleExit", root, Exit_Veh ) function Enter_Veh ( thePed ) if ( Carro[thePed]) and isElement ( Carro[thePed] ) then if ( isTimer( Tempo[thePed] ) ) then killTimer ( Tempo[thePed] ) end end end addEventHandler ( "onVehicleEnter", root, Enter_Veh )
MKZ Posted April 24, 2022 Author Posted April 24, 2022 2 hours ago, MKZ said: vlw mano me ajudou muito 3 hours ago, carlinloko said: testa ae local Tempo = { } function Exit_Veh ( thePed ) if ( getElementModel ( source ) == 413 ) then if ( Carro[thePed] ) and isElement ( Carro[thePed] ) then triggerClientEvent ( thePed, "addBox", root, "INFO : Você tem 5 minutos para voltar pra van", "info" ) Tempo[thePed] = setTimer ( function ( thePed ) if ( isElement ( Object_Caixa[thePed] ) ) then destroyElement ( Object_Caixa[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_Van[thePed] ) ) then destroyElement ( Marker_Van[thePed] ) end destroyElement ( Carro[thePed] ) removeCommandHandler("caixa", Pegar_Caixa_Object) setElementData ( thePed, "Entrega_Acionada", false ) setElementData ( thePed, "DNL:Entregar_Cargas", false ) setElementData( thePed, "DNL:Cargas", 0 ) triggerClientEvent ( thePed, "addBox", root, "INFO : Sua van foi destruida e seu emprego foi encerrado", "info" ) end, 300000, 1, thePed ) end end end addEventHandler ( "onVehicleExit", root, Exit_Veh ) function Enter_Veh ( thePed ) if ( Carro[thePed]) and isElement ( Carro[thePed] ) then if ( isTimer( Tempo[thePed] ) ) then killTimer ( Tempo[thePed] ) end end end addEventHandler ( "onVehicleEnter", root, Enter_Veh ) usei o thePed no script do trabalho de caminhao e nao foi function Exit_Veh (thePed) if (getElementModel (source) == 514) then if getElementData(thePed, "Viagem") == true then triggerClientEvent(thePed, "addBox", root, "INFO : Você tem 1 Minutos e meio para que volte pro caminhão", "error") Tempo[thePed] = setTimer ( function(thePed) if isElement(Marker_Entregar[thePed]) then destroyElement(Marker_Entregar[thePed]) end if isElement(Blip_Entregar[thePed]) then destroyElement(Blip_Entregar[thePed]) end if isElement(Caminhao[thePed]) then destroyElement(Caminhao[thePed]) end if isElement(Carga_Caminhao[thePed]) then destroyElement(Carga_Caminhao[thePed]) end if isElement(Marker_Carga[thePed]) then destroyElement(Marker_Carga[thePed]) end if isElement(Blip_Carga[thePed]) then destroyElement(Blip_Carga[thePed]) end if isElement(Blip_Carga2[thePed]) then destroyElement(Blip_Carga2[thePed]) end if getElementData(thePed, "Viagem") == true then setElementData(source, "Viagem", false) else end triggerClientEvent(thePed, "addBox", root, "INFO : Você não voltou para o veiculo e acabou perdendo a viagem", "info") end, 90000, 1 ) end end end addEventHandler ("onVehicleExit", root, Exit_Veh) function Enter_Veh (thePed) if (Caminhao[thePed]) and isElement(Caminhao[thePed]) then if isTimer(Tempo[thePed]) then killTimer(Tempo[thePed]) end end end addEventHandler ("onVehicleEnter", root, Enter_Veh)
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