MKZ Posted April 24, 2022 Share Posted April 24, 2022 eu estou tentando fazer com que quando o player saia da van do sedex e envie uma mensagem falando "Voce tem 10 minutos para voltar pra van" senao a van ia ser destruida. 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) 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