FloatingDamage::FloatingDamage(float startX, float startY)
{
    // Initialize
    lifetime = 500;
    toBeDeleted = false;
    SetDeathTime();
    Renderer.Initialize(1.0f, 1.0f, 64, 64, 10, 0, 0, 0, 1, 0.0f, startX, startY, "alpha.png");
}
Example #2
0
void CLocalPlayer::OnDeath( CNetworkPlayer * pKiller )
{
	// Are we not marked as dead?
	if( !IsDead() )
	{
		// Get the old camera lock state
		bOldCameraState = pCore->GetCamera()->IsLocked ();

		// Get the old control state
		bOldCTRLState = AreControlsLocked ();

		// Mark as dead
		SetDead( true );

		// Set the death time
		m_ulDeathTime = SharedUtility::GetTime();

		// Mark as not spawned
		SetSpawned( false );

		// Mark as not aiming
		SetAiming( false );

		// Mark as not shooting
		SetShooting( false );

		// Set the death time
		SetDeathTime( SharedUtility::GetTime() );

		// Remove all the weapons
		m_pPlayerPed->RemoveAllWeapons ();

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

		// Write the killerid
		pBitStream.WriteCompressed( (pKiller ? pKiller->GetId() : INVALID_ENTITY_ID) );

		// Send RPC to server
		pCore->GetNetworkModule()->Call( RPC_PLAYER_DEATH, &pBitStream, HIGH_PRIORITY, RELIABLE, true );

		// Fade out the screen
		pCore->GetHud()->FadeOut ( 3000 );

		// Fade out the sound
		pCore->GetGame()->FadeSound ( true, 3 );

		// Lock the camera control
		pCore->GetCamera()->LockControl ( true );

		// Lock the player controls
		LockControls ( true );
	}
}