Vehicle Automatic Respawn - Help ASAP
#1

Hello,
I am in a vital need for a automatic unused car respawner. So every unused vehicle respawns after 20 seconds.
Please somebody help me with this. I tried making it with timers but totally failed. If someone could kindly make it for me, I'll be Thankful.

PS - I also searched but only found where they respawn with a command. I want it automatically every 20 seconds
Reply
#2

https://sampwiki.blast.hk/wiki/AddStaticVehicleEx See this... Set respawn_delay (The delay until the car is respawned without a driver, in seconds) to 20.

Hope I helped
Reply
#3

Yes, I saw that. But the car respawns in that amount of time after the player exits it. I want every unused car to respawn after 20 seconds. Driven or not.
Reply
#4

That should respawn every car if it had been undriven for 20 seconds... However here is a topic asking the same question as you https://sampforum.blast.hk/showthread.php?tid=166660 There is a command you should use on this topic by Ritchie999.
Reply
#5

Fixed. I got a Timer to work.
Thanks to Grim on another Thread

Quote:

// Somewhere, like in a command
SetTimer( "RespawnVehicles", 5000, false ); // Change '5000' to make a different delay

// After main( )
forward RespawnVehicles( );
public RespawnVehicles( )
{
new vehicles[ MAX_VEHICLES ];
for( new i = 0; i < MAX_PLAYERS; i ++ )
{
if( IsPlayerInAnyVehicle( i ) )
{
vehicles[ GetPlayerVehicleID( i ) ] = 1;
}
}

for( new v = 0; v < MAX_VEHICLES; v ++ )
{
if( vehicles[ v ] == 1 ) continue;
SetVehicleToRespawn( v );
}
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)