SA-MP Forums Archive
Respawn nearby 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: Respawn nearby vehicles (/showthread.php?tid=106311)



Respawn nearby vehicles - pziemczyk - 02.11.2009

Hello, anybody know how to create hm command to respawn nearby vehicles?


Re: Respawn nearby vehicles - dirkblok - 02.11.2009

Quote:
Originally Posted by pziemczyk
Hello, anybody know how to create hm command to respawn nearby vehicles?
How you mean?

To spawn a whole new vehicle with a command like with /landstalker that it creates a vehicle ?

I don't get it, because vehicles are streamed already in samp 0.3


Re: Respawn nearby vehicles - Pinehole - 02.11.2009

here is one

http://forum.sa-mp.com/index.php?topic=74035.0


Re: Respawn nearby vehicles - pziemczyk - 02.11.2009

Respawn = Reset
Reset to spawn nearby vehicles...


Re: Respawn nearby vehicles - pziemczyk - 03.11.2009

UP, please help me with this problem.


Re: Respawn nearby vehicles - MadeMan - 03.11.2009

pawn Код:
RespawnNearbyVehicles(playerid, Float:radi)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i=1; i<MAX_VEHICLES; i++)
    {
        if(GetVehicleModel(i))
        {
            new Float:posx, Float:posy, Float:posz;
            new Float:tempposx, Float:tempposy, Float:tempposz;
            GetVehiclePos(i, posx, posy, posz);
            tempposx = (posx - x);
            tempposy = (posy - y);
            tempposz = (posz - z);
            if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
            {
                SetVehicleToRespawn(i);
            }
        }
    }
}
If you use RespawnNearbyVehicles(playerid, 10); then it will respawn all vehicles in radius of 10.