SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 07/05/2018, 02:22 AM   #1
nbx2000
Big Clucker
 
Join Date: Dec 2016
Posts: 72
Reputation: 0
Default auto respawn

Is it possible to return this cmd to be automatically, to respawnall cars automatically every 5 minutes?


CMD:respawnallcars(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 6) {
for(new v=0;v<MAX_VEHICLES;v++) {
if(!IsVehicleOccupied(v))
if(IsValidVehicle(v)) {
if(VehicleInfo[v][Temp] == 0) VehicleInfo[v][respawn] = 1;
EraseVehicle(v);
}
}
return SendClientMessage(playerid,0xFFFFFFAA," All empty cars were respawned !");
} else return SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: You need to be administrator level 6 to use this command");
}
nbx2000 is offline   Reply With Quote
Old 07/05/2018, 08:29 AM   #2
Rektumiliam
Little Clucker
 
Rektumiliam's Avatar
 
Join Date: Dec 2017
Location: Valhalla
Posts: 29
Reputation: 8
Default Re: auto respawn

You could use a timer for that, or even better http://wiki.sa-mp.com/wiki/AddStaticVehicleEx
Rektumiliam is offline   Reply With Quote
Old 07/05/2018, 03:54 PM   #3
Monotox
Gangsta
 
Monotox's Avatar
 
Join Date: Mar 2015
Location: São Paulo - SP
Posts: 518
Reputation: 37
Default Re: auto respawn

I think is more simple use the parameter "respawn_delay" in the car declaration.

AddStaticVehicleEx parameters:
Code:
(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren=0)
See more here: http://wiki.sa-mp.com/wiki/AddStaticVehicleEx
__________________
Knowledge is the key to freedom
Monotox is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto car respawn SilverStand Scripting Help 3 11/01/2016 08:22 AM
Auto respawn orel56000 Scripting Help 4 23/08/2015 04:55 PM
[FilterScript] Auto Car Respawn slorunner Filterscripts 4 09/11/2014 10:08 AM
Need Help about auto car respawn xinix000 Help Archive 2 16/06/2010 08:19 AM


All times are GMT. The time now is 12:17 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.