Public feed #599664

Anonymous

public text v1 · immutable
Raw Edit
·published 2007-07-02 11:29 UTC
rendered paste body
	            new vehicleid = GetPlayerVehicleID( playerid );
	            new Float:a;
				GetVehicleZAngle( vehicleid , a );

	            RemovePlayerFromVehicle( playerid );
	            SetVehicleToRespawn( vehicleid );
	            SetTimerEx( "DestroyVehicleEx" , 5000 , 0 , "i" , vehicleid );
	            new newvehicle = CreateVehicle( CurrentRace[ rCheckpoints ][ cpVehicle ][ cCP ] ,
				CurrentRace[ rCheckpoints ][ X ][ cCP ] ,
				CurrentRace[ rCheckpoints ][ Y ][ cCP ] ,
				CurrentRace[ rCheckpoints ][ Z ][ cCP ] ,
				a , -1 , -1 , -1 );
				
				SetTimerEx( "PutPlayerInVehicleEx" , 500 , 0 , "iii" , playerid , newvehicle , 0 );
				CurrentRace[ rVehicles ][ i ] = newvehicle;


public DestroyVehicleEx( vehicleid )
{
	printf( "DestroyVehicleEx %d" , vehicleid );
	new incar;
	for ( new i; i < MAX_PLAYERS; i++ )
	{
	    if ( IsPlayerConnected( i ) && IsPlayerInVehicle( i , vehicleid ) )
	    {
	        incar++;
	        RemovePlayerFromVehicle( i );
		}
	}

	if ( incar > 0 )
	{
		SetTimerEx( "DestroyVehicleEx" , 2000 , 0 , "i" , vehicleid );
	} else
	{
		DestroyVehicle( vehicleid );
	}
}

public PutPlayerInVehicleEx( playerid , vehicleid , seatid )
{
	PutPlayerInVehicle( playerid , vehicleid , seatid );
}