Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Gulk on Apr 12, 2015, 02:32 PM

Title: SetVehicleIdleRespawnTimer
Post by: Gulk on Apr 12, 2015, 02:32 PM
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 ^
Title: Re: SetVehicleRespawnTimer
Post by: . on Apr 12, 2015, 03:04 PM
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.
Title: Re: SetVehicleRespawnTimer
Post by: DizzasTeR on Apr 12, 2015, 04:08 PM
SetVehicleRespawnTimer( vehicleid, time );

I can see that format, the arguments are self explanatory, so try it.
Title: Re: SetVehicleIdleRespawnTimer
Post by: Kratos_ on Apr 13, 2015, 11:25 AM
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 .
Title: Re: SetVehicleIdleRespawnTimer
Post by: Rocky on Apr 13, 2015, 12:36 PM
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.
Title: Re: SetVehicleIdleRespawnTimer
Post by: morphine on Apr 13, 2015, 12:42 PM
Simplest way to do it would be to loop through all the vehicles on the server with this function.