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; }
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); }
/*********************** * 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()); }