コード例 #1
0
ファイル: lvdm.cpp プロジェクト: Pupak/sampgdk
PLUGIN_EXPORT bool PLUGIN_CALL OnPlayerDeath(int playerid, int killerid, int reason)
{
  int playercash;
  if(killerid == INVALID_PLAYER_ID) {
    SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
    ResetPlayerMoney(playerid);
  } else {
    SendDeathMessage(killerid,playerid,reason);
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    playercash = GetPlayerMoney(playerid);
    if (playercash > 0)  {
      GivePlayerMoney(killerid, playercash);
      ResetPlayerMoney(playerid);
    }
  }
   return true;
}
コード例 #2
0
void ExperienceSystem::RenderScore()
{
	if(mUpdateScoreFlag)
		mUpdateScoreFlag--;
	else
	{
		mUpdateScoreFlag = 60;
		mPlayerScore += Resources::mEnemyList->GetEnemySpeedModifier();
	}

	Resources::mParafontFont->DrawTextAlignedRight(Resources::STR_SCORE_OSD +
												   string(static_cast<ostringstream*>
												   ( &(ostringstream() << GetPlayerScore()) )->str()), 5);
	Resources::mParafontFont->DrawTextAlignedRight(Resources::STR_HI_SCORE_OSD +
												   string(static_cast<ostringstream*>
												   ( &(ostringstream() << Resources::mSkillsSystem->GetHiScore()) )
												   ->str()), 35);
}
コード例 #3
0
ファイル: Level.cpp プロジェクト: JcFowles/SpaceInvaders
/***********************
* UpdateScoreText: Updates the text that contains the playres score
* @author: Jc Fowles
* @parameter: _fScore: amount to update score by
* @return: void
********************/
void CLevel::UpdateScoreText()
{
    m_strScore = "Bricks Remaining: ";

    m_strScore += ToString(GetPlayerScore());
}