Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[code-snippet] Bonus for planting the bomb (SnD)

Опубликовано:

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.

Featured Replies

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.