CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
Black Ops II Zombies: GSC scripts, included upgraded infinite scrolling system
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Xeirh" data-source="post: 65214" data-attributes="member: 201981"><p>[SPOILER="Infinite Afterlife MOTD"]</p><p>[CODE]</p><p>self.infinite_afterlives = !( isdefined( self.infinite_afterlives ) && self.infinite_afterlives );</p><p></p><p>while ( self.infinite_afterlives )</p><p>{</p><p> lives = isdefined( self.afterlives_total ) ? self.afterlives_total : ( isdefined(</p><p>level.is_forever_solo_game</p><p>) &&</p><p>level.is_forever_solo_game</p><p>? 3 : 1 );</p><p></p><p> if ( isdefined( self.lives ) && self.lives < lives )</p><p> {</p><p> self.lives = lives;</p><p> self maps\mp\_utility::setclientfieldtoplayer( "player_lives", self.lives );</p><p> }</p><p></p><p> self waittill( "fake_death" );</p><p>}</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Infinite Afterlife Mana MOTD"]</p><p>[CODE]</p><p>self.infinite_mana = !( isdefined( self.infinite_mana ) && self.infinite_mana );</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Infinite Consecutive Electric Cherry Attacks"]</p><p>[CODE]</p><p>self.consecutive_cherry = !( isdefined( self.consecutive_cherry ) && self.consecutive_cherry );</p><p></p><p>while ( self.consecutive_cherry )</p><p>{</p><p> self waittill( "reload" );</p><p></p><p> if ( isdefined( self.consecutive_electric_cherry_attacks ) && self.consecutive_electric_cherry_attacks > 0 )</p><p> self.consecutive_electric_cherry_attacks = 0;</p><p>}</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Infinite Tomahawks MOTD"]</p><p>[CODE]</p><p>self.infinite_tomahawk = !( isdefined( self.infinite_tomahawk ) && self.infinite_tomahawk );</p><p></p><p>while ( self.infinite_tomahawk )</p><p>{</p><p> self waittill( "grenade_fire", e_grenade, str_grenade_name );</p><p> if ( str_grenade_name == "bouncing_tomahawk_zm" || str_grenade_name == "upgraded_tomahawk_zm" )</p><p> self setweaponammostock( str_grenade_name, 1 );</p><p>}</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Retain Perks"]</p><p>[CODE]</p><p>retain_perks()</p><p>{</p><p> self._retain_perks = !( isdefined( self._retain_perks ) && self._retain_perks );</p><p>}</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Ignore Lava Damage"]</p><p>[CODE]</p><p>ignore_lava_damage()</p><p>{</p><p> self.ignore_lava_damage = !( isdefined( self.ignore_lava_damage ) && self.ignore_lava_damage );</p><p>}</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Powerup Magnet"]</p><p>[CODE]</p><p>self.powerup_magnet = !( isdefined( self.powerup_magnet ) && self.powerup_magnet );</p><p></p><p>while ( self.powerup_magnet )</p><p>{</p><p> foreach ( powerup_index, powerup in level.active_powerups )</p><p> if ( distance( self.origin, powerup.origin ) < 400 )</p><p> powerup moveto( self.origin, 0.5 );</p><p></p><p> wait 0.05;</p><p>}</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Spawners"]</p><p>[CODE]</p><p>level.zombie_spawners = !isdefined( level.zombie_spawners ) ? getentarray( "zombie_spawner", "script_noteworthy" ) : undefined;</p><p></p><p>level.screecher_spawners = !isdefined( level.screecher_spawners ) ? getentarray( "screecher_zombie_spawner", "script_noteworthy" ) : undefined;</p><p></p><p>level.avogadro_spawners = !isdefined( level.avogadro_spawners ) ? getentarray( "avogadro_zombie_spawner", "script_noteworthy" ) : undefined;</p><p></p><p>level.dog_spawners = !isdefined( level.dog_spawners ) ? getentarray( "zombie_dog_spawner", "script_noteworthy" ) : undefined;</p><p></p><p>level.mechz_spawners = !isdefined( level.mechz_spawners ) ? getentarray( "mechz_spawner", "script_noteworthy" ) : undefined;</p><p></p><p>level.brutus_spawners = !isdefined( level.brutus_spawners ) ? getentarray( "brutus_zombie_spawner", "script_noteworthy" ) : undefined;</p><p></p><p>level.leaper_spawners = !isdefined( level.leaper_spawners ) ? getentarray( "leaper_zombie_spawner", "script_noteworthy" ) : undefined;</p><p></p><p>level.ghost_spawners = !isdefined( level.ghost_spawners ) ? getentarray( "ghost_zombie_spawner", "script_noteworthy" ) : undefined;</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>[SPOILER="Custom Perk Array"]</p><p>This applies only to valid perks. The logic is as follows: if the map is zm_tomb, we use the existing array from the random perk machine. If the map is not zm_tomb, we create an empty array and populate it by filtering through the valid perk machines, adding each perk name to the array.</p><p>[CODE]</p><p>level.specialties = !isdefined( level._random_perk_machine_perk_list ) ? [] : level._random_perk_machine_perk_list;</p><p></p><p>if ( !isdefined( level._random_perk_machine_perk_list ) )</p><p>{</p><p> foreach ( vending_index, vending_machine in getentarray( "zombie_vending", "targetname" ) )</p><p> {</p><p> if ( isdefined( vending_machine.script_noteworthy ) && vending_machine.script_noteworthy == "specialty_weapupgrade" )</p><p> continue;</p><p></p><p> level.specialties[ level.specialties.size ] = vending_machine.script_noteworthy;</p><p> }</p><p>}</p><p>[/CODE]</p><p>Perk image names</p><p></p><p>[/SPOILER]</p><p></p><p>[SPOILER="Infinite Scrolling System - Fully Resizable"]</p><p><strong>self.option_limit:</strong> defines the number limit of options in the menu structure. It’s recommended to use odd values only, as even values can cause issues with this system.</p><p><strong>self.option_spacing:</strong> controls the spacing between options, value of 16 works best across all titles.</p><p><strong>self.y_offset:</strong> sets the vertical position of the menu.</p><p><strong>self.color_theme:</strong> stores the color theme used by the menu structure.</p><p><strong>self.structure:</strong> is the structure array. As you can see, the arrays are kept minimal and clean. This is because the virtual machine does not retain static addresses for arrays, meaning it must index them each time they're accessed. Smaller arrays result in better performance.</p><p></p><p>You'll also notice that I'm checking the array index and its corresponding field are defined. This is important because failing to do so can trigger script runtime errors in the virtual machine. Opcode errors are rarely seen by most, but many menu structures are full of them. While these errors typically don't cause visible issues, they should still be treated as actual errors. Typically caused by undefined variables.</p><p>[CODE]</p><p>update_scrolling()</p><p>{</p><p> cursor = self get_cursor();</p><p> limit_split = int( ( self.option_limit / 2 ) );</p><p></p><p> if ( cursor >= self.structure.size || cursor < 0 )</p><p> self set_cursor( cursor >= self.structure.size ? 0 : ( self.structure.size - 1 ) );</p><p></p><p> if ( !isdefined( self.structure[ ( cursor - limit_split ) ] ) || self.structure.size <= self.option_limit )</p><p> {</p><p> for ( index = 0; index < self.option_limit; index++ )</p><p> {</p><p> self.menu_option[ index ] settext( isdefined( self.structure[ index ] ) && isdefined( self.structure[ index ].title ) ? self.structure[ index ].title : "" );</p><p> self.menu_option[ index ].color = ( cursor == index ) ? self.color_theme : ( 1, 1, 1 );</p><p> }</p><p></p><p> self.scrollbar_cache = ( ( self.y_offset + 16 ) + ( cursor * self.option_spacing ) );</p><p> }</p><p> else</p><p> {</p><p> if ( isdefined( self.structure[ ( cursor + limit_split ) ] ) )</p><p> {</p><p> xepixtvx = 0;</p><p></p><p> for ( index = ( cursor - limit_split ); index < ( cursor + ( limit_split + 1 ) ); index++ )</p><p> {</p><p> self.menu_option[ xepixtvx ] settext( isdefined( self.structure[ index ] ) && isdefined( self.structure[ index ].title ) ? self.structure[ index ].title : "" );</p><p> self.menu_option[ xepixtvx ].color = ( cursor == index ) ? self.color_theme : ( 1, 1, 1 );</p><p></p><p> xepixtvx++;</p><p> }</p><p></p><p> self.scrollbar_cache = ( ( self.y_offset + 16 ) + ( limit_split * self.option_spacing ) );</p><p> }</p><p> else</p><p> {</p><p> for ( index = 0; index < self.option_limit; index++ )</p><p> {</p><p> invert = ( self.structure.size + ( index - self.option_limit ) );</p><p></p><p> self.menu_option[ index ] settext( isdefined( self.structure[ invert ] ) && isdefined( self.structure[ invert ].title ) ? self.structure[ invert ].title : "" );</p><p> self.menu_option[ index ].color = ( cursor == invert ) ? self.color_theme : ( 1, 1, 1 );</p><p> }</p><p></p><p> self.scrollbar_cache = ( ( self.y_offset + 16 ) + ( ( ( cursor - self.structure.size ) + self.option_limit ) * self.option_spacing ) );</p><p> }</p><p> }</p><p>}</p><p></p><p>// another useful function</p><p>correct_cursor()</p><p>{</p><p> if( self get_cursor() >= self.structure.size )</p><p> self set_cursor( ( self.structure.size - 1 ) );</p><p>}</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>Love you guys, enjoy the scripts</p></blockquote><p></p>
[QUOTE="Xeirh, post: 65214, member: 201981"] [SPOILER="Infinite Afterlife MOTD"] [CODE] self.infinite_afterlives = !( isdefined( self.infinite_afterlives ) && self.infinite_afterlives ); while ( self.infinite_afterlives ) { lives = isdefined( self.afterlives_total ) ? self.afterlives_total : ( isdefined( level.is_forever_solo_game ) && level.is_forever_solo_game ? 3 : 1 ); if ( isdefined( self.lives ) && self.lives < lives ) { self.lives = lives; self maps\mp\_utility::setclientfieldtoplayer( "player_lives", self.lives ); } self waittill( "fake_death" ); } [/CODE] [/SPOILER] [SPOILER="Infinite Afterlife Mana MOTD"] [CODE] self.infinite_mana = !( isdefined( self.infinite_mana ) && self.infinite_mana ); [/CODE] [/SPOILER] [SPOILER="Infinite Consecutive Electric Cherry Attacks"] [CODE] self.consecutive_cherry = !( isdefined( self.consecutive_cherry ) && self.consecutive_cherry ); while ( self.consecutive_cherry ) { self waittill( "reload" ); if ( isdefined( self.consecutive_electric_cherry_attacks ) && self.consecutive_electric_cherry_attacks > 0 ) self.consecutive_electric_cherry_attacks = 0; } [/CODE] [/SPOILER] [SPOILER="Infinite Tomahawks MOTD"] [CODE] self.infinite_tomahawk = !( isdefined( self.infinite_tomahawk ) && self.infinite_tomahawk ); while ( self.infinite_tomahawk ) { self waittill( "grenade_fire", e_grenade, str_grenade_name ); if ( str_grenade_name == "bouncing_tomahawk_zm" || str_grenade_name == "upgraded_tomahawk_zm" ) self setweaponammostock( str_grenade_name, 1 ); } [/CODE] [/SPOILER] [SPOILER="Retain Perks"] [CODE] retain_perks() { self._retain_perks = !( isdefined( self._retain_perks ) && self._retain_perks ); } [/CODE] [/SPOILER] [SPOILER="Ignore Lava Damage"] [CODE] ignore_lava_damage() { self.ignore_lava_damage = !( isdefined( self.ignore_lava_damage ) && self.ignore_lava_damage ); } [/CODE] [/SPOILER] [SPOILER="Powerup Magnet"] [CODE] self.powerup_magnet = !( isdefined( self.powerup_magnet ) && self.powerup_magnet ); while ( self.powerup_magnet ) { foreach ( powerup_index, powerup in level.active_powerups ) if ( distance( self.origin, powerup.origin ) < 400 ) powerup moveto( self.origin, 0.5 ); wait 0.05; } [/CODE] [/SPOILER] [SPOILER="Spawners"] [CODE] level.zombie_spawners = !isdefined( level.zombie_spawners ) ? getentarray( "zombie_spawner", "script_noteworthy" ) : undefined; level.screecher_spawners = !isdefined( level.screecher_spawners ) ? getentarray( "screecher_zombie_spawner", "script_noteworthy" ) : undefined; level.avogadro_spawners = !isdefined( level.avogadro_spawners ) ? getentarray( "avogadro_zombie_spawner", "script_noteworthy" ) : undefined; level.dog_spawners = !isdefined( level.dog_spawners ) ? getentarray( "zombie_dog_spawner", "script_noteworthy" ) : undefined; level.mechz_spawners = !isdefined( level.mechz_spawners ) ? getentarray( "mechz_spawner", "script_noteworthy" ) : undefined; level.brutus_spawners = !isdefined( level.brutus_spawners ) ? getentarray( "brutus_zombie_spawner", "script_noteworthy" ) : undefined; level.leaper_spawners = !isdefined( level.leaper_spawners ) ? getentarray( "leaper_zombie_spawner", "script_noteworthy" ) : undefined; level.ghost_spawners = !isdefined( level.ghost_spawners ) ? getentarray( "ghost_zombie_spawner", "script_noteworthy" ) : undefined; [/CODE] [/SPOILER] [SPOILER="Custom Perk Array"] This applies only to valid perks. The logic is as follows: if the map is zm_tomb, we use the existing array from the random perk machine. If the map is not zm_tomb, we create an empty array and populate it by filtering through the valid perk machines, adding each perk name to the array. [CODE] level.specialties = !isdefined( level._random_perk_machine_perk_list ) ? [] : level._random_perk_machine_perk_list; if ( !isdefined( level._random_perk_machine_perk_list ) ) { foreach ( vending_index, vending_machine in getentarray( "zombie_vending", "targetname" ) ) { if ( isdefined( vending_machine.script_noteworthy ) && vending_machine.script_noteworthy == "specialty_weapupgrade" ) continue; level.specialties[ level.specialties.size ] = vending_machine.script_noteworthy; } } [/CODE] Perk image names [/SPOILER] [SPOILER="Infinite Scrolling System - Fully Resizable"] [B]self.option_limit:[/B] defines the number limit of options in the menu structure. It’s recommended to use odd values only, as even values can cause issues with this system. [B]self.option_spacing:[/B] controls the spacing between options, value of 16 works best across all titles. [B]self.y_offset:[/B] sets the vertical position of the menu. [B]self.color_theme:[/B] stores the color theme used by the menu structure. [B]self.structure:[/B] is the structure array. As you can see, the arrays are kept minimal and clean. This is because the virtual machine does not retain static addresses for arrays, meaning it must index them each time they're accessed. Smaller arrays result in better performance. You'll also notice that I'm checking the array index and its corresponding field are defined. This is important because failing to do so can trigger script runtime errors in the virtual machine. Opcode errors are rarely seen by most, but many menu structures are full of them. While these errors typically don't cause visible issues, they should still be treated as actual errors. Typically caused by undefined variables. [CODE] update_scrolling() { cursor = self get_cursor(); limit_split = int( ( self.option_limit / 2 ) ); if ( cursor >= self.structure.size || cursor < 0 ) self set_cursor( cursor >= self.structure.size ? 0 : ( self.structure.size - 1 ) ); if ( !isdefined( self.structure[ ( cursor - limit_split ) ] ) || self.structure.size <= self.option_limit ) { for ( index = 0; index < self.option_limit; index++ ) { self.menu_option[ index ] settext( isdefined( self.structure[ index ] ) && isdefined( self.structure[ index ].title ) ? self.structure[ index ].title : "" ); self.menu_option[ index ].color = ( cursor == index ) ? self.color_theme : ( 1, 1, 1 ); } self.scrollbar_cache = ( ( self.y_offset + 16 ) + ( cursor * self.option_spacing ) ); } else { if ( isdefined( self.structure[ ( cursor + limit_split ) ] ) ) { xepixtvx = 0; for ( index = ( cursor - limit_split ); index < ( cursor + ( limit_split + 1 ) ); index++ ) { self.menu_option[ xepixtvx ] settext( isdefined( self.structure[ index ] ) && isdefined( self.structure[ index ].title ) ? self.structure[ index ].title : "" ); self.menu_option[ xepixtvx ].color = ( cursor == index ) ? self.color_theme : ( 1, 1, 1 ); xepixtvx++; } self.scrollbar_cache = ( ( self.y_offset + 16 ) + ( limit_split * self.option_spacing ) ); } else { for ( index = 0; index < self.option_limit; index++ ) { invert = ( self.structure.size + ( index - self.option_limit ) ); self.menu_option[ index ] settext( isdefined( self.structure[ invert ] ) && isdefined( self.structure[ invert ].title ) ? self.structure[ invert ].title : "" ); self.menu_option[ index ].color = ( cursor == invert ) ? self.color_theme : ( 1, 1, 1 ); } self.scrollbar_cache = ( ( self.y_offset + 16 ) + ( ( ( cursor - self.structure.size ) + self.option_limit ) * self.option_spacing ) ); } } } // another useful function correct_cursor() { if( self get_cursor() >= self.structure.size ) self set_cursor( ( self.structure.size - 1 ) ); } [/CODE] [/SPOILER] Love you guys, enjoy the scripts [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
Black Ops II Zombies: GSC scripts, included upgraded infinite scrolling system
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top