Andres99907 Posted December 14, 2018 Share Posted December 14, 2018 I have this: function Salir() if isElement(tableVehicles[source]) then destroyElement(tableVehicles[source]) end end addEventHandler("onPlayerVehicleExit",getRootElement(),Salir) This function destroys the vehicle when the player leaves, I want this to happen after a second and not immediately, i need to use "Set timer", but I do not know how to use it, I tried different ways but none of them Link to comment
Captain Cody Posted December 14, 2018 Share Posted December 14, 2018 (edited) timers = {} function Salir() if isElement(tableVehicles[source]) then destroyElement(tableVehicles[source]) if timers[source] then killTimer(timers[source]) end timers[source] = setTimer ( removeVehicle, 1000, 1, source ) end end function removeVehicle(player) destroyElement(tableVehicles[player]) tableVehicles[player] = nil end addEventHandler("onPlayerVehicleExit",getRootElement(),Salir) Also, next time please use https://forum.multitheftauto.com/forum/71-scripting/ or the corresponding scripting section for your language (Which from what I can tell is obviously not English.) Edited December 14, 2018 by CodyJ(L) 1 Link to comment
Andres99907 Posted December 15, 2018 Author Share Posted December 15, 2018 EspañolInglésItaliano---------------Detectar idiomaAfrikáansAlbanésAlemánAmáricoÁrabeArmenioAzerbaiyanoBengalíBielorrusoBirmanoBosnioBúlgaroCanarésCatalánCebuanoChecoChino (Simplificado)Chino (Tradicional)CingalésCoreanoCorsoCriollo haitianoCroataDanésEslovacoEslovenoEspañolEsperantoEstonioEuskeraFinésFrancésFrisón occidentalGaélico escocésGalésGallegoGeorgianoGriegoGuyaratíHausaHawaianoHebreoHindiHmongHúngaroIgboIndonesioInglésIrlandésIslandésItalianoJaponésJavanésJemerKazajoKirguísKurdoLaoLatínLetónLituanoLuxemburguésMacedonioMalayalamMalayoMalgacheMaltésMaoríMaratíMongolNeerlandésNepalíNoruegoNyanjaPanyabíPastúnPersaPolacoPortuguésRumanoRusoSamoanoSerbioShonaSindhiSomalíSotho meridionalSuajiliSuecoSundanésTagaloTailandésTamilTayikoTeluguTurcoUcranianoUrduUzbekoVietnamitaXhosaYidisYorubaZulúEspañol Thank you! , I really appreciate it C: 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