[Help] Respawn cars
#1

I need to make a respawn command, because people can spawn cars, and after a while the map gets a mess.
Reply
#2

READ - https://sampwiki.blast.hk/wiki/CreateVehicle

Change the respawn_dalay

But you will still have problems.... because if they can spawn cars every here... the car will respawn here the player spawned him the frist time... so if they spawn like 10 cars they will respawn and stay on thier frist spawn location.
Reply
#3

Код:
if(strcmp(cmd,"/respawncars",true)==0)
{
  if(IsPlayerAdmin(playerid))
  for(new v = 1; v <= MAX_VEHICLES; v++) SetVehicleToRespawn(v);
  return 1;
}
Reply
#4

But than the vehicles that are used will spawn too.
I know an better one:
Somewhere by the forward things:

Quote:

forward IsVehicleOccupied(vehicleid);

Then down the script:

Quote:

public IsVehicleOccupied(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid)) return 1;
}
return 0;
}

and the command:

Quote:

if(strcmp(cmd, "/reloadcars", true) == 0)
{
if (IsPlayerAdmin(playerid))
{
for(new i=0;i<MAX_VEHICLES;i++)
{
if(IsVehicleOccupied(i) == 0)
{
SetVehicleToRespawn(i);
}
}
SendClientMessageToAll(an_color, "All vehicles reloaded!");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use this command");
}
return 1;
}

ENJOY IY!
xD
Reply
#5

Quote:
Originally Posted by Fedee!
I need to make a respawn command, because people can spawn cars, and after a while the map gets a mess.
(srry for dubbelpost)
sorry but this respawn (the message above) respawn the spawned cars too
Make a good /vec script dat delete the previous vehicle that is spawned.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)