[Help] Respawn cars - 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: [Help] Respawn cars (
/showthread.php?tid=120407)
[Help] Respawn cars -
Fedee! - 11.01.2010
I need to make a respawn command, because people can spawn cars, and after a while the map gets a mess.
Re: [Help] Respawn cars -
Cr0ssFir3 - 11.01.2010
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.
Re: [Help] Respawn cars -
bajskorv123 - 11.01.2010
Код:
if(strcmp(cmd,"/respawncars",true)==0)
{
if(IsPlayerAdmin(playerid))
for(new v = 1; v <= MAX_VEHICLES; v++) SetVehicleToRespawn(v);
return 1;
}
Re: [Help] Respawn cars -
Kwarde - 11.01.2010
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
Re: [Help] Respawn cars -
Kwarde - 11.01.2010
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.