SA-MP Forums Archive
[FilterScript] Respawncars - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Respawncars (/showthread.php?tid=547552)



Respawncars - JaydenJason - 23.11.2014

This was my first little script I made in a long while ago, meanwhile I've advanced in scripting and I had published this as I roam around quite some servers, and most of the times all the vehicles are in the most idiotic places, 50 vehicles in a small place, that's why I made this quick little thing to respawn those vehicles.




PHP код:
CMD:respawncars(playeridparams[])
{
    if(
IsPlayerAdmin(playerid)) // var can be changed
        
{
                new 
Float:XFloat:YFloat:Zdistance;
                if(
sscanf(params"d"distance)) distance 10;
                for(new 
0MAX_VEHICLESi++)
                {
                        
GetVehiclePos(iXYZ);
                        if(
IsPlayerInRangeOfPoint(playeriddistanceXYZ))
                        {
                            
SetVehicleToRespawn(i);
                        }
                }
        }
        return 
1;

Pastebin: http://pastebin.com/1WfF9MEc


Re: Respawncars - LeXuZ - 23.11.2014

Cool command, could come in useful when having a load of vehicles in a small space, nice work


Re: Respawncars - jamjamnewbie - 23.11.2014

Based on your command, I assume there's no need for foreach.inc?


Re: Respawncars - JaydenJason - 23.11.2014

Quote:
Originally Posted by jamjamnewbie
Посмотреть сообщение
Based on your command, I assume there's no need for foreach.inc?
yeppers, apologies


Re: Respawncars - N.K.Stallone - 23.11.2014

Not bad, keep learning!


Re: Respawncars - M0HAMMAD - 23.11.2014

nice command. it's good.


Re: Respawncars - JaydenJason - 24.11.2014

Quote:
Originally Posted by bgtracker
Посмотреть сообщение
Not bad, keep learning!
Quote:
Originally Posted by M0HAMMAD
Посмотреть сообщение
nice command. it's good.
Cheers, more motivation for me to continue scripting


Re: Respawncars - UltraScripter - 28.12.2014

Easy but good!