[HELP] Respawn Empty Cars ONLY - 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 Empty Cars ONLY (
/showthread.php?tid=188191)
[HELP] Respawn Empty Cars ONLY -
Camacorn - 06.11.2010
Hello, can someone help me make this command respawn ONLY empty cars instead of all? thanks.
Код:
command(vehrespawn, playerid, params[])
{
#pragma unused params
if( Player[playerid][AdminLevel] >= 5)
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(Vehicles[i][GameID] >= 1)
{
SetVehicleToRespawn(Vehicles[i][GameID]);
}
}
SendClientMessage( playerid, WHITE, "All saved vehicles have been respawned." );
}
return 1;
}
Re: [HELP] Respawn Empty Cars ONLY -
RyDeR` - 06.11.2010
Take a look at this example I wrote a while ago:
pawn Код:
forward RespawnCars();
public RespawnCars()
{
new
needed[MAX_VEHICLES],
i,
v;
while(i != MAX_PLAYERS)
{
needed[GetPlayerVehicleID(i)] = (IsPlayerInAnyVehicle(i) == 1) ? (1) : (0);
++i;
}
while(v != MAX_VEHICLES)
{
if(!needed[v]) SetVehicleToRespawn(v);
++v;
}
return 1;
}
Re: [HELP] Respawn Empty Cars ONLY -
DeathOnaStick - 06.11.2010
Quote:
Originally Posted by Camacorn
Hello, can someone help me make this command respawn ONLY empty cars instead of all? thanks.
Код:
command(vehrespawn, playerid, params[])
{
#pragma unused params
if( Player[playerid][AdminLevel] >= 5)
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(Vehicles[i][GameID] >= 1)
{
SetVehicleToRespawn(Vehicles[i][GameID]);
}
}
SendClientMessage( playerid, WHITE, "All saved vehicles have been respawned." );
}
return 1;
}
|
Honestly, I have answered many of this topics yet.
Search and you will
find...
Re: [HELP] Respawn Empty Cars ONLY -
Camacorn - 06.11.2010
DeathOnAStick, it works, but it keeps reloading the cars over and over and over. They load from a .djson file.
Re: [HELP] Respawn Empty Cars ONLY -
DeathOnaStick - 06.11.2010
Quote:
Originally Posted by Camacorn
DeathOnAStick, it works, but it keeps reloading the cars over and over and over. They load from a .djson file.
|
Show me your exact code and I will try to fix it.