Random infernus
#1

Hello everyone i am trying to make a command that will search through all server and find all infernus cars and then everytime i use the command a checkpoint will be set on a random infernus

Exampls :
first time command used checkpoint set to infernus 5
second time inferno 1
third time inferno 2
and so on

This is my code:
PHP код:
//infernus location
    
AddStaticVehicle(411,1527.3868,106.3463,29.6184,62.5420,25,1); //
    
AddStaticVehicle(411,1431.6229,34.1600,31.8009,162.9018,25,1); // 1414
    
AddStaticVehicle(411,1370.7400,-17.6774,33.9628,160.7644,25,1); // 1515
    
AddStaticVehicle(411,1299.2028,-76.8083,36.5903,99.1094,25,1); // 1616
    
AddStaticVehicle(411,1215.8567,-144.4778,39.8548,114.5100,25,1); // 1717
//mycommand
new CarSelected[MAX_VEHICLES];
CMD:randcar(playeridparams[])
{
    for(new 
i=0increment 0i<MAX_VEHICLESi++)
    {
        if(
GetVehicleModel(i) == 411)
        {
            
CarSelected[increment] = i;
            
increment++;
        }
    }
    new 
randcar random(sizeof(CarSelected)), Float:vPos[3];
    
GetVehiclePos(CarSelected[randcar], vPos[0], vPos[1], vPos[2]);
    
SetPlayerCheckpoint(playeridvPos[0], vPos[1], vPos[2], 5.0);
    return 
1;

Reply


Messages In This Thread
Random infernus - by SalmaN97 - 09.02.2016, 00:13
Re: Random infernus - by Jefff - 09.02.2016, 00:31
Re: Random infernus - by SalmaN97 - 09.02.2016, 00:43
Re: Random infernus - by SalmaN97 - 09.02.2016, 00:48

Forum Jump:


Users browsing this thread: 1 Guest(s)