[FilterScript] Respawncars
#1

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
Reply
#2

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

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

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

Not bad, keep learning!
Reply
#6

nice command. it's good.
Reply
#7

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
Reply
#8

Easy but good!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)