SetVehicleIdleRespawnTimer

Started by Gulk, Apr 12, 2015, 02:32 PM

Previous topic - Next topic

Gulk

How do I use this? I want to make all vehicles in a server respawn after a certain amount of time if they are unused.

Quotetypedef int (*SDK_SetVehicleIdleRespawnTimer) (int nVehicleId, unsigned int uTimer);
from new VCMP.h ^

.

I believe it's per/vehicle as with Pickups. Though I haven't really used this. I believe it's for when the vehicle is destroyed. To, automatically, re-spawn that vehicle instance after the specified time.
.

DizzasTeR

SetVehicleRespawnTimer( vehicleid, time );

I can see that format, the arguments are self explanatory, so try it.

Kratos_

I'm not sure about that timer's units . Try giving the values in millisec or in secs format .  If vehicle isn't spawned on setting timer assuming its format as millisec then probably the correct format is secs cuz in that case probably it will take a huge time lag then .
QuoteIf someone is sure about timer's format for this function then correct me if I'm wrong here .
In the middle of chaos , lies opportunity.

Rocky

Quote from: Doom_Killer on Apr 12, 2015, 04:08 PMSetVehicleRespawnTimer( vehicleid, time );

I can see that format, the arguments are self explanatory, so try it.


He is referring to SetVehicleIdleRespawnTimer. If the vehicle is unused for a certain amount of time then he wants it to be re spawned at its orginal position whereas SetVehicleRespawnTimer respawns only when the vehicle is destroyed. I'm not sure this function really exists. If it doesn't then you should create a function that checks if the vehicle's position is within the position of the orginal spawn radius if not then manually respawn it, doing this might lag a bit lot since the only way to do that is with timers i guess.

morphine

Simplest way to do it would be to loop through all the vehicles on the server with this function.