How do I spawn all unused vehicles? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How do I spawn all unused vehicles? (
/showthread.php?tid=121723)
How do I spawn all unused vehicles? -
xkniives - 18.01.2010
How do I spawn all unused vehicles? I want it so only admins can do it. The script I'm using is:
http://forum.sa-mp.com/index.php?topic=92546.0
Re: How do I spawn all unused vehicles? -
Onyx09 - 19.01.2010
im a Respawn All Cars Command
Код:
if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
new bool:unwanted[CAR_AMOUNT];
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 268; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "SERVER: All unused cars respawned by %s.", sendername);
BroadCast(COLOR_WHITE,string);
}
return 1;
}
bassically that is make sure in ur cars define number u select the number of the cars u want to respawn with that command
actually cars wont spawn if someone is on it so u can use for example spawn cars from 1 to the number you have iif you get it
and is set for admins lvl 3 and higher u can change you know modify the command to get your self satisfated let me know if you need something alse or if you have any problems adding it