Ejemplo n.º 1
0
void CObject::Explode()
{
    CVector pos = GetPos();
    pos.z += 0.5;
    CExplosion::AddExplosion(this, GetPlayerPed(-1), 9, pos, 100, 1, -1.0, 0);
    if (m_colDamageEffect == 202 || m_colDamageEffect == 200)
    {
        pos.z -= 1.0;
        ObjectDamage(10000.0f, pos, 0, GetPlayerPed(-1), 51);
    }
    else if (!m_disableFriction)
    {
        m_linearVelocity.z += 0.5;
        m_linearVelocity.x += (rand() - 128) * 0.000199999994947575;
        m_linearVelocity.y += (rand() - 128) * 0.000199999994947575;
        if (bIsStatic || bIsStaticWaitingForCollision)
        {
            SetIsStatic(false);
            AddToMovingList();
        }
    }
    if (m_objectInfo->fxType == 2)
    {
        CMatrix pos = GetMatrix();
        // to object space
        CVector fxObjPos = Multiply3x3(pos, m_objectInfo->fxOffset);
        fxObjPos += GetPos(); // to world space
        FxSystem_c *sys = FxManager.InitialiseFxSystem(m_objectInfo->fxSystem, fxObjPos, 0, 0);
        if (sys)
        {
            sys->Start();
        }
    }
}
Ejemplo n.º 2
0
void CLocalPlayer::SendPassengerSync( void )
{
	// Are we not connected to the network?
	if( !pCore->GetNetworkModule()->IsConnected() )
		return;

	// Are we dead?
	if( IsDead() )
		return;

	// Get the vehicle instance
	CNetworkVehicle * pVehicle = pCore->GetVehicleManager()->GetFromGameGUID( GetPlayerPed()->GetCurrentVehicle()->m_dwGUID );

	// Did we fail to find the vehicle?
	if( !pVehicle )
		return;

	// Construct a new bitstream
	RakNet::BitStream pBitStream;

	// Construct a new passenger sync data structure
	InPassengerSync passengerSync;

	// Get the player health
	passengerSync.m_fHealth = GetHealth ();

	// Get the player selected weapon
	passengerSync.m_dwSelectedWeapon = GetSelectedWeapon ();

	// Write the sync structure to the bitstream
	pBitStream.Write( (char *)&passengerSync, sizeof(InPassengerSync) );

	// Send the bitstream to the server
	pCore->GetNetworkModule()->Call( RPC_PASSENGER_SYNC, &pBitStream, LOW_PRIORITY, UNRELIABLE_SEQUENCED, true );
}
Ejemplo n.º 3
0
void main(void)
{
	TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME("scriptmgr");
	ADD_ARMOUR_TO_CHAR(GetPlayerPed(), 100);
	CLEAR_ZONE(414.907, 28.0238, 8.79453, 200.0);
	SET_THIS_SCRIPT_CAN_REMOVE_BLIPS_CREATED_BY_ANY_SCRIPT(1);
	INIT_SETTINGS(420.828, 28.8978, 8.78683, 100.0);
	while ( ++num_items < MAX_PAGES ) selection_mem[num_items] = 0;
	while ( !IS_PLAYER_SCRIPT_CONTROL_ON(GetPlayerIndex()) ) WAIT(1000);
	
    while (TRUE)
    {
		WAIT(0);
		GET_CHAR_COORDINATES(GetPlayerPed(), &px, &py, &pz);
		GET_CHAR_HEADING(GetPlayerPed(), &ph);
		
		if(objrc == 0)
		{
			DRAW_MENU();
			PRINT_MAIN_LOGO(0.43, 0.05, "Lost MC RIP");
			PRINT_DESC(0.35, 0.11, "Recreation of GTA V Online mission \"Lost MC RIP\"");
			//PRINT_DESC(0.20, 0.13, "Test1");
			//PRINT_DESC(0.20, 0.15, "Test2");
		}
		
		if(objrc > objstart && objrc != objend)
		{
			PRINT_LIVES();
			POLICE(0, 0);
			MANAGE_PLAYER();
			MANAGE_ACTORS(14);
			ALTER_WANTED_LEVEL(GetPlayerIndex(), 0);	
		}
	
		if(objrc == 1)
		{
			UNLOCK_FRONTEND_DISPLAYS();
			APPLY_SELECTED_OPTIONS(level, weather, time);
			CLEAR_ZONE(480.671, 330.929, 8.57156, 50.0);
			SPAWN_VEHICLE(0, vehmodel,  BLIP_COLOR_WHITE, 414.907, 28.0238, 8.79453, 10.0, 25000, 0);
			SPAWN_VEHICLE(1, MODEL_HELLFURY, NOBLIP,  480.671, 330.929, 8.57156, 287.0, vhealth, 1);
			SPAWN_VEHICLE(2, MODEL_HELLFURY, NOBLIP,  500.989, 331.218, 8.57157, 287.0, vhealth, 1);
			SPAWN_VEHICLE(3, MODEL_HELLFURY, NOBLIP,  462.637, 342.84,  8.57144, 287.0, vhealth, 1);
			SPAWN_VEHICLE(4, MODEL_HELLFURY, NOBLIP,  456.194, 328.523, 8.57156, 287.0, vhealth, 1);
			SPAWN_VEHICLE(5, MODEL_ROMERO,   NOBLIP,  469.083, 341.918, 8.57143,   0.0, vhealth, 1);
			SPAWN_ACTOR(0,   MODEL_M_M_GBIK_LO_03, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 477.765, 330.598, 8.57155, 0.0, 0);
			SPAWN_ACTOR(1,   MODEL_M_Y_GBIK_HI_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 487.11,  332.822, 8.58402, 0.0, 0);
			SPAWN_ACTOR(2,   MODEL_M_Y_GBIK_HI_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 462.72,  329.053, 8.57155, 0.0, 0);
			SPAWN_ACTOR(3,   MODEL_M_Y_GBIK_LO_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 455.702, 331.683, 8.57326, 0.0, 0);
			SPAWN_ACTOR(4,   MODEL_M_Y_GBIK_LO_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 453.886, 342.619, 8.57142, 0.0, 0);
			SPAWN_ACTOR(5,   MODEL_M_M_GBIK_LO_03, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 455.879, 353.054, 8.57143, 0.0, 0);
			SPAWN_ACTOR(6,   MODEL_M_Y_GBIK_HI_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 461.334, 354.282, 8.55088, 0.0, 0);
			SPAWN_ACTOR(7,   MODEL_M_Y_GBIK_HI_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 452.701, 350.135, 8.57144, 0.0, 0);
			SPAWN_ACTOR(8,   MODEL_M_Y_GBIK_LO_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 475.867, 352.833, 8.57144, 0.0, 0);
			SPAWN_ACTOR(9,   MODEL_M_Y_GBIK_LO_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 485.464, 355.757, 8.57232, 0.0, 0);
			SPAWN_ACTOR(10,  MODEL_M_M_GBIK_LO_03, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 494.51,  355.139, 8.57158, 0.0, 0);
			SPAWN_ACTOR(11,  MODEL_M_Y_GBIK_HI_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 501.969, 343.139, 8.57158, 0.0, 0);
			SPAWN_ACTOR(12,  MODEL_M_Y_GBIK_HI_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 510.718, 339.741, 8.57158, 0.0, 0);
			SPAWN_ACTOR(13,  MODEL_M_Y_GBIK_LO_01, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 513.053, 328.065, 8.57157, 0.0, 0);
			SPAWN_ACTOR(14,  MODEL_M_Y_GBIK_LO_02, WEAPON_M4,  BLIP_COLOR_RED, accuracy, ehealth, armour, 0, 505.737, 314.082, 8.57796, 0.0, 0);
			PLAY_CHECKPOINT_SOUND();
			objrc++;
		}
		
		if(objrc == 2)
		{
			PRINT_TXT("Take out the ~R~Lost~S~");
			
			if(peds[0].retc == 2 && peds[1].retc == 2 && peds[2].retc == 2 && peds[3].retc == 2 && peds[4].retc == 2 && peds[5].retc == 2 && peds[6].retc == 2 && peds[7].retc == 2 && peds[8].retc == 2 && peds[9].retc == 2 && peds[10].retc == 2 && peds[11].retc == 2 && peds[12].retc == 2 && peds[13].retc == 2 && peds[14].retc == 2)
			{
				objrc++;
			}	
		}
		
		if(objrc == 3)
		{
			MISSION_COMPLETE("", 13000);
		}
	}
}
Ejemplo n.º 4
0
void main(void)
{
	int i;
	TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME("scriptmgr");
	CLEAR_ZONE(2237.89, 184.489, 5.85721, 200.0);
	INIT_SETTINGS(2237.89, 184.489, 5.85721, 0.0);
	ADD_ARMOUR_TO_CHAR(GetPlayerPed(), 100);
	CLEAR_ZONE(2225.7,  345.369, 17.2112, 200.0);
	SET_THIS_SCRIPT_CAN_REMOVE_BLIPS_CREATED_BY_ANY_SCRIPT(1);

	while (TRUE)
    {
		WAIT(0);
		GET_CHAR_COORDINATES(GetPlayerPed(), &px, &py, &pz);
		GET_CHAR_HEADING(GetPlayerPed(), &ph);
		
		if(objrc == 0)
		{
			DRAW_MENU();
			PRINT_MAIN_LOGO(0.39, 0.05, "The Parking Garage");
			PRINT_DESC(0.34, 0.11, "Recreation of GTA V Online mission \"The Parking Garage\"");
			//PRINT_DESC(0.20, 0.13, "Test1");
			//PRINT_DESC(0.20, 0.15, "Test2");
		}
		
		if(objrc > objstart && objrc != objend)
		{
			PRINT_LIVES();
			POLICE(0, 0);
			MANAGE_PLAYER();
			MANAGE_ACTORS(21);
			MANAGE_VEHICLES(8);
		}
		
		if(objrc == 1)
		{
			UNLOCK_FRONTEND_DISPLAYS();
			APPLY_SELECTED_OPTIONS(level, weather, time);
			SPAWN_VEHICLE(0, vehmodel, BLIP_COLOR_WHITE, 2236.36, 191.781, 5.96358, 270.0, 25000, 0);
			SPAWN_VEHICLE(1, MODEL_PMP600, NOBLIP,  2225.7,  345.369, 17.2112, 0.0,   vhealth, 1);
			SPAWN_VEHICLE(2, MODEL_PMP600, NOBLIP,  2235.81, 344.851, 17.2112, 0.0,   vhealth, 1);
			SPAWN_VEHICLE(3, MODEL_PMP600, NOBLIP,  2237.24, 362.006, 17.2112, 180.0, vhealth, 1);
			SPAWN_VEHICLE(4, MODEL_PMP600, NOBLIP,  2226.02, 361.978, 17.2112, 180.0, vhealth, 1);
			
			for(i=1;i<=4;i++)
			{
				OPEN_CAR_DOOR(vehs[i].car, 0);
				OPEN_CAR_DOOR(vehs[i].car, 1);
				OPEN_CAR_DOOR(vehs[i].car, 2);
				OPEN_CAR_DOOR(vehs[i].car, 3);
			}
			
			SPAWN_ACTOR(0,  MODEL_M_Y_GLAT_LO_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2241.71, 349.074, 17.2112, 180.0, 0);
			SPAWN_ACTOR(1,  MODEL_M_Y_GLAT_LO_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2236.66, 352.623, 17.2112, 180.0, 0);
			SPAWN_ACTOR(2,  MODEL_M_Y_GLAT_HI_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2234.38, 351.852, 17.2112, 180.0, 0);
			SPAWN_ACTOR(3,  MODEL_M_Y_GLAT_HI_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2220.1,  355.928, 17.2112, 180.0, 0);
			SPAWN_ACTOR(4,  MODEL_M_Y_GLAT_LO_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2218.18, 350.432, 17.2112, 180.0, 0);
			SPAWN_ACTOR(5,  MODEL_M_Y_GLAT_LO_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2224.79, 349.411, 17.2112, 180.0, 0);
			SPAWN_ACTOR(6,  MODEL_M_Y_GLAT_HI_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2221.69, 367.831, 17.2112, 180.0, 0);
			SPAWN_ACTOR(7,  MODEL_M_Y_GLAT_HI_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2228.39, 374.876, 17.2111, 180.0, 0);
			SPAWN_ACTOR(8,  MODEL_M_Y_GLAT_LO_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2246.78, 372.589, 17.3392, 180.0, 0);
			SPAWN_ACTOR(9,  MODEL_M_Y_GLAT_LO_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2247.09, 360.237, 17.3619, 180.0, 0);
			SPAWN_ACTOR(10, MODEL_M_Y_GLAT_HI_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2234.74, 335.179, 17.2112,   0.0, 0);
			SPAWN_ACTOR(11, MODEL_M_Y_GLAT_HI_02, WEAPON_M4,  NOBLIP, accuracy, ehealth, armour, 10, 2230.77, 335.418, 17.2112,   0.0, 0);
			SPAWN_ACTOR(12, MODEL_M_Y_GLAT_LO_02, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2228.00, 344.176, 17.2112, 180.0, 0);
			SPAWN_ACTOR(13, MODEL_M_Y_GLAT_HI_01, WEAPON_MP5, NOBLIP, accuracy, ehealth, armour, 10, 2240.39, 344.829, 17.2112, 180.0, 0);
			TASK_CHAT_WITH_CHAR(peds[10].actor, peds[13].actor, 1, 1);
			TASK_CHAT_WITH_CHAR(peds[11].actor, peds[12].actor, 0, 1);
			PLAY_CHECKPOINT_SOUND();
			objrc++;
		}
		
		if(objrc == 2)
		{
			SET_MISSION_CHECKPOINT(0, 2265.86, 310.3, 3.93312, 4.0, "Go to the ~Y~parking lot~S~");
		}
		
		if(objrc == 3)
		{
			GET_GROUND_Z_FOR_3D_COORD(2247.02, 364.361, 17.3601, &zg);
			CREATE_PICKUP(drugbag, 22, 2247.02, 364.361, zg, &document2, 1);
			objrc++;
		}
		
		if(objrc == 4)
		{
			PRINT_TXT("Get the ~b~document~s~");
			
			if(HAS_PICKUP_BEEN_COLLECTED(document2))
			{
				PLAY_CHECKPOINT_SOUND();
				objrc++;
			}
		}
		
		if(objrc == 5)
		{
			SET_MISSION_CHECKPOINT(0, 747.599, -119.14, 3.67973, 4.0, "Deliver the ~b~document~s~ to ~Y~Lester's warehourse~S~");
			SPAWN_ENEMY_CAR_IN_AREA(MODEL_HUNTLEY, 1847.66, 259.651, 5.34315, 5, 14, 15, MODEL_M_Y_GAFR_HI_01);
			SPAWN_ENEMY_CAR_IN_AREA(MODEL_HUNTLEY, 1854.45, 276.598, 5.134,   6, 16, 17, MODEL_M_Y_GAFR_HI_01);
			SPAWN_ENEMY_CAR_IN_AREA(MODEL_HUNTLEY, 1370.08, 295.171, 24.829,  7, 18, 19, MODEL_M_Y_GAFR_HI_01);
			SPAWN_ENEMY_CAR_IN_AREA(MODEL_HUNTLEY, 1357.89, 281.534, 25.8018, 8, 20, 21, MODEL_M_Y_GAFR_HI_01);			
		}
		
		if(objrc == 6)
		{
			MISSION_COMPLETE("", 20000);
		}
	}
}
Ejemplo n.º 5
0
Archivo: main.c Proyecto: Neproify/ivmp
void InitPlayer(void)
{
	SET_PLAYER_CONTROL(GetPlayerIndex(), TRUE);
	SET_CHAR_RELATIONSHIP_GROUP(GetPlayerPed(), 0);
}
Ejemplo n.º 6
0
void CLocalPlayer::OnEnterVehicle( void )
{
	// Get the vehicle instance from the vehicle guid
	CNetworkVehicle * pNetworkVehicle = pCore->GetVehicleManager()->GetFromGameGUID( GetPlayerPed()->GetCurrentVehicle()->m_dwGUID );

	// Is the vehicle instance valid?
	if( pNetworkVehicle )
	{
#ifdef _DEBUG
		M2Vehicle * pVehicle = pNetworkVehicle->GetVehicle()->GetVehicle();
		DWORD dwVehicleData = (DWORD)(pVehicle) + 0xA8;

		pCore->GetChat()->AddDebugMessage ( "Vehicle: 0x%p, VehicleData: 0x%p", pVehicle, dwVehicleData );
#endif

		// Set the initial seat as the driver
		EntityId seat = 0;

		// Is the player in the passenger seat?
		//if( GetState() == PLAYERSTATE_PASSENGER )
		//	seat = pNetworkVehicle->GetVehicle()->GetPedOccupiedSeat( GetPlayerPed()->GetPed() );

		// Does the vehicle already have a driver?
		if ( pNetworkVehicle->GetDriver () )
			seat = pNetworkVehicle->GetVehicle()->GetPedOccupiedSeat( GetPlayerPed()->GetPed() );

		// Are we getting in as the driver?
		if( seat == 0 )
			SetState( PLAYERSTATE_DRIVER );
		else
			SetState( PLAYERSTATE_PASSENGER );

#ifdef _DEBUG
		pCore->GetChat()->AddDebugMessage( "Seat: %d, Driver: 0x%p, State: %d", seat, pNetworkVehicle->GetDriver (), GetState () );
#endif

		// Construct a new bitstream
		RakNet::BitStream pBitStream;

		// Write the vehicle id
		pBitStream.WriteCompressed( pNetworkVehicle->GetId() );

		// Write the seat
		pBitStream.WriteCompressed( seat );

		// Send to the server
		pCore->GetNetworkModule()->Call( RPC_ENTER_VEHICLE, &pBitStream, HIGH_PRIORITY, RELIABLE_ORDERED, true );

#ifdef _DEBUG
		pCore->GetChat()->AddDebugMessage( "CLocalPlayer::OnEnterVehicle( %d, %d )", pNetworkVehicle->GetId(), seat );
#endif

		// Handle this enter with the network vehicle
		pNetworkVehicle->HandlePlayerEnter( this, seat );

		// Set the vehicle
		SetVehicle( pNetworkVehicle );

		// Set the seat
		SetSeat( seat );

		// Set the target data
		SetEnteringVehicle( pNetworkVehicle, seat );
	}
}
Ejemplo n.º 7
0
void CLocalPlayer::SendInVehicleSync( void )
{
	// Are we not connected to the network?
	if( !pCore->GetNetworkModule()->IsConnected() )
		return;

	// Are we dead?
	if( IsDead() )
		return;

	// Get the vehicle instance
	CNetworkVehicle * pVehicle = pCore->GetVehicleManager()->GetFromGameGUID( GetPlayerPed()->GetCurrentVehicle()->m_dwGUID );

	// Did we fail to find the vehicle?
	if( !pVehicle )
		return;

	// Construct a new bitstream
	RakNet::BitStream pBitStream;

	// Write the vehicle id
	pBitStream.WriteCompressed( pVehicle->GetId() );

	// Construct a new in vehicle sync data structure
	InVehicleSync inVehicleSync;

	// Get the vehicle position
	pVehicle->GetPosition( &inVehicleSync.m_vecPosition );

	// Get the vehicle rotation
	pVehicle->GetRotation( &inVehicleSync.m_vecRotation );

	// Get the vehicle dirt level
	inVehicleSync.m_fDirtLevel = pVehicle->GetVehicle()->GetDirtLevel();

	// Get the vehicle tuning table
	inVehicleSync.m_iTuningTable = pVehicle->GetVehicle()->GetTuningTable();

	// Get the vehicle horn state
	inVehicleSync.m_bHornState = pVehicle->GetVehicle()->IsHornOn();

	// Get the vehicle siren state
	inVehicleSync.m_bSirenState = pVehicle->GetVehicle()->IsSirenOn();

	// Get the vehicle fuel
	inVehicleSync.m_fFuel = pVehicle->GetVehicle()->GetFuel();

	// Get the vehicle speed
	pVehicle->GetSpeedVec( &inVehicleSync.m_vecVelocity );

	// Get the turn speed
	inVehicleSync.m_fTurnSpeed = pVehicle->GetSteer();

	// Get the engine damage
	inVehicleSync.m_fEngineDamage = pVehicle->GetVehicle()->GetEngineDamage();

	// Get the vehicle plate text
	strcpy( inVehicleSync.m_szPlateText, pVehicle->GetPlateText() );
	inVehicleSync.m_szPlateText[ 6 ] = '\0';

	// Get the vehicle colour
	pVehicle->GetColour( &inVehicleSync.m_primaryColour, &inVehicleSync.m_secondaryColour );

	// Get the power state
	inVehicleSync.m_bPower = pVehicle->GetVehicle()->GetPower();

	// Get the brake state
	inVehicleSync.m_bBrake = pVehicle->GetVehicle()->GetBrake();

	// Get the vehicle wheel models (DISABLED FOR TESTING)
	for ( int i = 0; i < 3; i++ )
		inVehicleSync.m_bWheelModels[ i ] = 0xFF; //Game::GetIdFromVehicleWheelModel ( pVehicle->GetVehicle()->GetWheelTexture ( i ) );

	// Get the handbrake state
	inVehicleSync.m_bHandbrake = pVehicle->GetVehicle()->IsHandbrakeOn ();

	// Get the light state
	inVehicleSync.m_bLightState = pVehicle->GetVehicle()->GetLightState ();

	// Write the sync structure into the bitstream
	pBitStream.Write( (char *)&inVehicleSync, sizeof(InVehicleSync) );

	// Send the bitstream to the server
	pCore->GetNetworkModule()->Call( RPC_VEHICLE_SYNC, &pBitStream, LOW_PRIORITY, UNRELIABLE_SEQUENCED, true );
}