Quote:
Originally Posted by Ballu Miaa
pawn Код:
forward AutoRespawn(); public AutoRespawn() { new bool:unwanted[500]; for(new player=0; player<MAX_PLAYERS; player++) { if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; } } for(new car = 1; car <= 450; car++) { if(!unwanted[car]) SetVehicleToRespawn(car); return 1; } } // Add this under OnGameModeInIt() SetTimer("AutoRespawn",1 * 60 * 1000,0);
NOTE:UNTESTED
|
Instead of doing all that hard work, use AddStaticVehicleEx and set the respawn delay time:
Parameters:
pawn Код:
AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, respawn_delay);
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx