jwalks Posted January 22, 2011 Share Posted January 22, 2011 function spawnVehs() for k, v in ipairs (getElementsByType("veh")) do createVehicle(getElementData(v,"model"),getElementData(v,"posX"),getElementData(v,"posY"),getElementData(v,"posZ"),0,0,getElementData(v,"rotation")) end for k, v in ipairs (getElementsByType("vehicle")) do toggleVehicleRespawn(v,true) setVehicleIdleRespawnDelay(v,120000) end end addEventHandler("onResourceStart",getResourceRootElement(),spawnVehs) function respawnVeh() setTimer(respawnVehicle,5000,1,source) end addEventHandler("onVehicleExplode",getRootElement(),respawnVeh) [2011-01-21 17:05:42] WARNING: Bad 'element' pointer @ 'respawnVehicle'(1) i get this warning symbol Link to comment
SDK Posted January 22, 2011 Share Posted January 22, 2011 I'm not sure why the timer doesn't work, but you can use this function instead (like you use setVehicleIdleRespawnDelay): https://wiki.multitheftauto.com/wiki/Set ... spawnDelay 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