[code-snippet] Bonus for planting the bomb (SnD)
Featured Replies
Сейчас на странице 0
- Нет пользователей, просматривающих эту страницу
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Используя этот сайт, вы соглашаетесь Условия использования.
So here is another code-snippet i made...
Someone requested something to make players playing the objective some more and wanted a "bonus" for players who plant the bomb. So i did this little snippet to increase the bombplanters killstreakcounter.
Well, i for myself don't really like the idea but anyway maybe someone wants to use this...
Get a clean sd.gsc and find the onUsePlantObject function.
Change it to:
onUsePlantObject( player ) { // planted the bomb if ( !self maps\mp\gametypes\_gameobjects::isFriendlyTeam( player.pers["team"] ) ) { level thread bombPlanted( self, player ); //player logString( "bomb planted: " + self.label ); // disable all bomb zones except this one for ( index = 0; index < level.bombZones.size; index++ ) { if ( level.bombZones[index] == self ) continue; level.bombZones[index] maps\mp\gametypes\_gameobjects::disableObject(); } player playSound( "mp_bomb_plant" ); player notify ( "bomb_planted" ); //if ( !level.hardcoreMode ) // iPrintLn( &"MP_EXPLOSIVES_PLANTED_BY", player ); leaderDialog( "bomb_planted" ); level thread teamPlayerCardSplash( "callout_bombplanted", player ); level.bombOwner = player; player thread maps\mp\gametypes\_hud_message::SplashNotify( "plant", maps\mp\gametypes\_rank::getScoreInfoValue( "plant" ) ); player thread maps\mp\gametypes\_rank::giveRankXP( "plant" ); player.bombPlantedTime = getTime(); maps\mp\gametypes\_gamescore::givePlayerScore( "plant", player ); player incPlayerStat( "bombsplanted", 1 ); player thread maps\mp\_matchdata::logGameEvent( "plant", player.origin ); //part i've added to increase killstreak counter and check if a new streak has to be given player.pers["cur_kill_streak"]++; //player iPrintLnBold( "Your killstreak count was increased by 1" ); level notify ( "player_got_killstreak_" + player.pers["cur_kill_streak"], player ); if ( isAlive( player ) ) player thread maps\mp\killstreaks\_killstreaks::checkKillstreakReward( player.pers["cur_kill_streak"] ); } }Example: You have set predator as your 1st killstreak award.
If you are e.g. at a killstreak of 4 and plant the bomb you will get the predator, as the counter gets increased to 5 for planting.
You might want to add some popUp text/scorePopup etc. to inform the player that his killstreak got increased.