SA-MP Forums Archive
Veh respawner - 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: Veh respawner (/showthread.php?tid=233774)



Veh destroyer Edited name /was respawn/ - sMog. - 02.03.2011

Hello, can someone make me filterscript that destroys car what are not used . It is very bad that player uses car and leaves car somwhere and car and it wont destroy .
i cant found it anywere.


Sorry my bad english.


Re: Veh respawner - JaTochNietDan - 02.03.2011

All you have to do is change the respawn_time argument of the function that's creating it, most likely CreateVehicle if it's never respawning after being left alone for a long time. See this page on the SA-MP Wiki for more information:

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


Re: Veh respawner - CyNiC - 02.03.2011

pawn Код:
//On the top:
#define TIMER_TO_RESPAWN 5000 //change if want

//Put in OnGameModeInit:

SetTimer("RespawnAllVehicles", TIMER_TO_RESPAWN, true);

//Put in end of your gamemode/filterscript:

forward RespawnAllVehicles();
public RespawnAllVehicles()
{
    new playerid;
    for(new i = 0; i < MAX_VEHICLES; ++i)
    {
        do
        {
            if(!IsPlayerInVehicle(playerid, i)) SetVehicleToRespawn(i);
            playerid++;
        }
        while(playerid < MAX_PLAYERS);
    }
    return true;
}



Re: Veh respawner - sMog. - 02.03.2011

Thanks for that i get it, but this is not what i mean .

i want the script destroys cars what are not in use.

i have in server command /destroycar but anywon wont use it.