HELP +REP
#9

PHP код:
stock RespawnAllVehicles( )
{
    for( new 
1<= GetVehiclePoolSize( ); i++ ) //vehicle IDs start at 1.
    
{
        for( new 
0<= GetPlayerPoolSize( ); p++ ) // looping through connected players
        
{
            if( 
IsPlayerInVehiclep) ) // if someone's driving the current vehicle we're checking 
                
continue; // exit the player loop as we don't need to check any further
        
}
        if( 
IsVehicleTrailer) && IsVehicleAttachedToTrailer) ) // if it's a trailer, and if it's attached to some vehicle
            
continue; // tell the loop to continue on to the next vehicle as this one is a trailer attached to a vehicle 
        
SetVehicleToRespawn); // respawn the vehicle if it's unoccupied and not attached to any vehicle 
    
}
    return 
1;
}
IsVehicleTrailervehicleid )
{
    switch( 
GetVehicleModelvehicleid ) )
    {
        case 
435450584591: return true// if it's a trailer
        
default: return false// if not
    
}
    return 
false// return false by default
}
IsVehicleAttachedToTrailertrailerid )
{
    for( new 
1GetVehiclePoolSize( ); i++ )
    {
        if( 
GetVehicleTrailer) == trailerid // if the trailer attached to this vehicle is the trailer
            
return true;
    }
    return 
false;

Untested, but should work
Reply


Messages In This Thread
HELP +REP - by KingPersona - 11.05.2015, 18:26
Re: HELP +REP - by Crayder - 11.05.2015, 23:31
Re: HELP +REP - by Sithis - 12.05.2015, 08:25
Re: HELP +REP - by KingPersona - 14.05.2015, 22:10
Re: HELP +REP - by Crayder - 14.05.2015, 22:35
Re: HELP +REP - by KingPersona - 15.05.2015, 10:39
Re: HELP +REP - by Threshold - 15.05.2015, 10:55
Re: HELP +REP - by keyvanik - 15.05.2015, 12:37
Re: HELP +REP - by Smileys - 15.05.2015, 13:25
Re: HELP +REP - by KingPersona - 15.05.2015, 13:28

Forum Jump:


Users browsing this thread: 2 Guest(s)