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 )