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
Call of Duty: Black Ops 2 Scripts Questions
Call of Duty: Black Ops 2 Answered Questions
How do you spawn power ups? [ZM]
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="CabCon" data-source="post: 5844" data-attributes="member: 1"><p>First of all you need to create a function, which gave you the power up. I used the function from the game and spawn the powerup at my self.origin so the player will take it instatly. </p><p></p><p><strong>Add this function to your script: </strong></p><p>[CODE]</p><p>func_GivePowerUp(powerup_name) //INPUT is the "Code" name of a powerup.</p><p>{</p><p> if (!isDefined(level.zombie_include_powerups) || (!(level.zombie_include_powerups.size > 0))) //check the powerup are allowed?</p><p> self iprintln("Power Ups ^1Not Supported ^7On This Map");</p><p> else</p><p> {</p><p> level.powerup_drop_count = 0;</p><p> powerup = level maps/mp/zombies/_zm_powerups::specific_powerup_drop(powerup_name, self.origin);</p><p> if (powerup_name == "teller_withdrawl")</p><p> powerup.value = 1000;</p><p> powerup thread maps/mp/zombies/_zm_powerups::powerup_timeout();</p><p> self iprintln("PowerUps (" + powerup_name + ") ^2Gived^7");</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>If you done that, you need to create the menu list for the powerups. </p><p><strong>That's my one: </strong></p><p>[CODE]updateMenu_powerups_list_menu()</p><p>{</p><p> self addmenu("main_powerups", "Power Ups Menu", "main");</p><p> /*powerups = GetArrayKeys(level.zombie_include_powerups); //TODO: old version I do newone because the names ... :D</p><p> for(i = 0; i < fxs.size; i++)</p><p> {</p><p> self addMenuPar_withDef("main_powerups","Spawn "+powerups[i],::GivePowerUp, powerups[i]);</p><p> wait .00001;</p><p> }*/</p><p> if (isDefined(level.zombie_include_powerups) && (level.zombie_include_powerups.size > 0)) </p><p> {</p><p> self addMenuPar_withDef("main_powerups","Toggle Shoot PowerUps",::Toggle_ShootPowerUps);</p><p> if (isDefined( level.zombie_include_powerups["nuke"]))</p><p> self addMenuPar_withDef("main_powerups", "Nuke Bomb", ::GivePowerUp, "nuke");</p><p> if (isDefined( level.zombie_include_powerups["green_nuke"]))</p><p> self addMenuPar_withDef("main_powerups", "Green Nuke Bomb", ::GivePowerUp, "green_nuke");</p><p> if (isDefined( level.zombie_include_powerups["red_nuke"]))</p><p> self addMenuPar_withDef("main_powerups", "Red Nuke Bomb", ::GivePowerUp, "red_nuke");</p><p> if (isDefined( level.zombie_include_powerups["yellow_nuke"]))</p><p> self addMenuPar_withDef("main_powerups", "Yellow Nuke Bomb", ::GivePowerUp, "yellow_nuke");</p><p> if (isDefined( level.zombie_include_powerups["insta_kill"]))</p><p> self addMenuPar_withDef("main_powerups", "Insta Kill", ::GivePowerUp, "insta_kill");</p><p> if (isDefined( level.zombie_include_powerups["green_insta"]))</p><p> self addMenuPar_withDef("main_powerups", "Green Insta Kill", ::GivePowerUp, "green_insta");</p><p> if (isDefined(level.zombie_include_powerups["insta_kill_ug"]))</p><p> self addMenuPar_withDef("main_powerups", "Insta Kill Ug", ::GivePowerUp, "insta_kill_ug"); </p><p> if (isDefined(level.zombie_include_powerups["full_ammo"]))</p><p> self addMenuPar_withDef("main_powerups", "Full Ammo", ::GivePowerUp, "full_ammo");</p><p> if (isDefined(level.zombie_include_powerups["green_ammo"]))</p><p> self addMenuPar_withDef("main_powerups", "Green Full Ammo", ::GivePowerUp, "green_ammo");</p><p> if (isDefined(level.zombie_include_powerups["red_ammo"]))</p><p> self addMenuPar_withDef("main_powerups", "Red Full Ammo", ::GivePowerUp, "red_ammo");</p><p> if (isDefined(level.zombie_include_powerups["double_points"]))</p><p> self addMenuPar_withDef("main_powerups", "Double Points", ::GivePowerUp, "double_points");</p><p> if (isDefined(level.zombie_include_powerups["green_double"]))</p><p> self addMenuPar_withDef("main_powerups", "Green Double Points", ::GivePowerUp, "green_double");</p><p> if (isDefined(level.zombie_include_powerups["yellow_double"]))</p><p> self addMenuPar_withDef("main_powerups", "Red Double Points", ::GivePowerUp, "red_double");</p><p> if (isDefined(level.zombie_include_powerups["yellow_double"]))</p><p> self addMenuPar_withDef("main_powerups", "Yellow Double Points", ::GivePowerUp, "yellow_double");</p><p> if (isDefined(level.zombie_include_powerups["carpenter"]))</p><p> self addMenuPar_withDef("main_powerups", "Carpenter", ::GivePowerUp, "carpenter");</p><p> if (isDefined(level.zombie_include_powerups["fire_sale"]))</p><p> self addMenuPar_withDef("main_powerups", "Fire Sale", ::GivePowerUp, "fire_sale");</p><p> if (isDefined(level.zombie_include_powerups["bonfire_sale"]))</p><p> self addMenuPar_withDef("main_powerups", "Bonfire Sale", ::GivePowerUp, "bonfire_sale");</p><p> if (isDefined(level.zombie_include_powerups["minigun"]))</p><p> self addMenuPar_withDef("main_powerups", "Minigun", ::GivePowerUp, "minigun");</p><p> if (isDefined(level.zombie_include_powerups["free_perk"]))</p><p> self addMenuPar_withDef("main_powerups", "Free Perk", ::GivePowerUp, "free_perk");</p><p> if (isDefined(level.zombie_include_powerups["tesla"]))</p><p> self addMenuPar_withDef("main_powerups", "Tesla", ::GivePowerUp, "tesla");</p><p> if (isDefined(level.zombie_include_powerups["random_weapon"]))</p><p> self addMenuPar_withDef("main_powerups", "Random Weapon", ::GivePowerUp, "random_weapon");</p><p> if (isDefined(level.zombie_include_powerups["teller_withdrawl"]))</p><p> self addMenuPar_withDef("main_powerups", "Bank Points", ::GivePowerUp, "teller_withdrawl");</p><p> if (isDefined(level.zombie_include_powerups["bonus_points_player"]))</p><p> self addMenuPar_withDef("main_powerups", "Bonus Points Player", ::GivePowerUp, "bonus_points_player");</p><p> if (isDefined(level.zombie_include_powerups["lose_points_player"]))</p><p> self addMenuPar_withDef("main_powerups", "Lose Points Player", ::GivePowerUp, "lose_points_player");</p><p> if (isDefined(level.zombie_include_powerups["bonus_points_team"]))</p><p> self addMenuPar_withDef("main_powerups", "Bonus Points Team", ::GivePowerUp, "bonus_points_team");</p><p> if (isDefined(level.zombie_include_powerups["lose_points_team"]))</p><p> self addMenuPar_withDef("main_powerups", "Lose Points Team", ::GivePowerUp, "lose_points_team");</p><p> if (isDefined(level.zombie_include_powerups["lose_perk"]))</p><p> self addMenuPar_withDef("main_powerups", "Lose Perk", ::GivePowerUp, "lose_perk");</p><p> if (isDefined(level.zombie_include_powerups["empty_clip"]))</p><p> self addMenuPar_withDef("main_powerups", "Empty Clip", ::GivePowerUp, "empty_clip");</p><p> if (isDefined(level.zombie_include_powerups["meat_stink"]))</p><p> self addMenuPar_withDef("main_powerups", "Meat Stink", ::GivePowerUp, "meat_stink");</p><p> if (isDefined(level.zombie_include_powerups["the_cure"]))</p><p> self addMenuPar_withDef("main_powerups", "The Cure", ::GivePowerUp, "the_cure");</p><p> if (isDefined(level.zombie_include_powerups["blue_monkey"]))</p><p> self addMenuPar_withDef("main_powerups", "Blue Monkey", ::GivePowerUp, "blue_monkey");</p><p> if (isDefined(level.zombie_include_powerups["green_monkey"]))</p><p> self addMenuPar_withDef("main_powerups", "Green Monkey", ::GivePowerUp, "green_monkey");</p><p> if (isDefined(level.zombie_include_powerups["zombie_blood"]))</p><p> self addMenuPar_withDef("main_powerups", "Zombie Blood", ::GivePowerUp, "zombie_blood");</p><p> }</p><p>}[/CODE]</p><p></p><p>You can easily copy the Name and the Input and the if check from my list. <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /> The if checks the powerup status for each powerup. <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /> </p><p></p><p>Feel free to use it, but give credits <img src="/styles/default/xenforo/smilies.emoji/people/slight_smile.emoji.svg" class="smilie" loading="lazy" alt=":smile:" title="Smile :smile:" data-shortname=":smile:" /> </p><p>Regards,</p><p>CabCon.</p></blockquote><p></p>
[QUOTE="CabCon, post: 5844, member: 1"] First of all you need to create a function, which gave you the power up. I used the function from the game and spawn the powerup at my self.origin so the player will take it instatly. [B]Add this function to your script: [/B] [CODE] func_GivePowerUp(powerup_name) //INPUT is the "Code" name of a powerup. { if (!isDefined(level.zombie_include_powerups) || (!(level.zombie_include_powerups.size > 0))) //check the powerup are allowed? self iprintln("Power Ups ^1Not Supported ^7On This Map"); else { level.powerup_drop_count = 0; powerup = level maps/mp/zombies/_zm_powerups::specific_powerup_drop(powerup_name, self.origin); if (powerup_name == "teller_withdrawl") powerup.value = 1000; powerup thread maps/mp/zombies/_zm_powerups::powerup_timeout(); self iprintln("PowerUps (" + powerup_name + ") ^2Gived^7"); } } [/CODE] If you done that, you need to create the menu list for the powerups. [B]That's my one: [/B] [CODE]updateMenu_powerups_list_menu() { self addmenu("main_powerups", "Power Ups Menu", "main"); /*powerups = GetArrayKeys(level.zombie_include_powerups); //TODO: old version I do newone because the names ... :D for(i = 0; i < fxs.size; i++) { self addMenuPar_withDef("main_powerups","Spawn "+powerups[i],::GivePowerUp, powerups[i]); wait .00001; }*/ if (isDefined(level.zombie_include_powerups) && (level.zombie_include_powerups.size > 0)) { self addMenuPar_withDef("main_powerups","Toggle Shoot PowerUps",::Toggle_ShootPowerUps); if (isDefined( level.zombie_include_powerups["nuke"])) self addMenuPar_withDef("main_powerups", "Nuke Bomb", ::GivePowerUp, "nuke"); if (isDefined( level.zombie_include_powerups["green_nuke"])) self addMenuPar_withDef("main_powerups", "Green Nuke Bomb", ::GivePowerUp, "green_nuke"); if (isDefined( level.zombie_include_powerups["red_nuke"])) self addMenuPar_withDef("main_powerups", "Red Nuke Bomb", ::GivePowerUp, "red_nuke"); if (isDefined( level.zombie_include_powerups["yellow_nuke"])) self addMenuPar_withDef("main_powerups", "Yellow Nuke Bomb", ::GivePowerUp, "yellow_nuke"); if (isDefined( level.zombie_include_powerups["insta_kill"])) self addMenuPar_withDef("main_powerups", "Insta Kill", ::GivePowerUp, "insta_kill"); if (isDefined( level.zombie_include_powerups["green_insta"])) self addMenuPar_withDef("main_powerups", "Green Insta Kill", ::GivePowerUp, "green_insta"); if (isDefined(level.zombie_include_powerups["insta_kill_ug"])) self addMenuPar_withDef("main_powerups", "Insta Kill Ug", ::GivePowerUp, "insta_kill_ug"); if (isDefined(level.zombie_include_powerups["full_ammo"])) self addMenuPar_withDef("main_powerups", "Full Ammo", ::GivePowerUp, "full_ammo"); if (isDefined(level.zombie_include_powerups["green_ammo"])) self addMenuPar_withDef("main_powerups", "Green Full Ammo", ::GivePowerUp, "green_ammo"); if (isDefined(level.zombie_include_powerups["red_ammo"])) self addMenuPar_withDef("main_powerups", "Red Full Ammo", ::GivePowerUp, "red_ammo"); if (isDefined(level.zombie_include_powerups["double_points"])) self addMenuPar_withDef("main_powerups", "Double Points", ::GivePowerUp, "double_points"); if (isDefined(level.zombie_include_powerups["green_double"])) self addMenuPar_withDef("main_powerups", "Green Double Points", ::GivePowerUp, "green_double"); if (isDefined(level.zombie_include_powerups["yellow_double"])) self addMenuPar_withDef("main_powerups", "Red Double Points", ::GivePowerUp, "red_double"); if (isDefined(level.zombie_include_powerups["yellow_double"])) self addMenuPar_withDef("main_powerups", "Yellow Double Points", ::GivePowerUp, "yellow_double"); if (isDefined(level.zombie_include_powerups["carpenter"])) self addMenuPar_withDef("main_powerups", "Carpenter", ::GivePowerUp, "carpenter"); if (isDefined(level.zombie_include_powerups["fire_sale"])) self addMenuPar_withDef("main_powerups", "Fire Sale", ::GivePowerUp, "fire_sale"); if (isDefined(level.zombie_include_powerups["bonfire_sale"])) self addMenuPar_withDef("main_powerups", "Bonfire Sale", ::GivePowerUp, "bonfire_sale"); if (isDefined(level.zombie_include_powerups["minigun"])) self addMenuPar_withDef("main_powerups", "Minigun", ::GivePowerUp, "minigun"); if (isDefined(level.zombie_include_powerups["free_perk"])) self addMenuPar_withDef("main_powerups", "Free Perk", ::GivePowerUp, "free_perk"); if (isDefined(level.zombie_include_powerups["tesla"])) self addMenuPar_withDef("main_powerups", "Tesla", ::GivePowerUp, "tesla"); if (isDefined(level.zombie_include_powerups["random_weapon"])) self addMenuPar_withDef("main_powerups", "Random Weapon", ::GivePowerUp, "random_weapon"); if (isDefined(level.zombie_include_powerups["teller_withdrawl"])) self addMenuPar_withDef("main_powerups", "Bank Points", ::GivePowerUp, "teller_withdrawl"); if (isDefined(level.zombie_include_powerups["bonus_points_player"])) self addMenuPar_withDef("main_powerups", "Bonus Points Player", ::GivePowerUp, "bonus_points_player"); if (isDefined(level.zombie_include_powerups["lose_points_player"])) self addMenuPar_withDef("main_powerups", "Lose Points Player", ::GivePowerUp, "lose_points_player"); if (isDefined(level.zombie_include_powerups["bonus_points_team"])) self addMenuPar_withDef("main_powerups", "Bonus Points Team", ::GivePowerUp, "bonus_points_team"); if (isDefined(level.zombie_include_powerups["lose_points_team"])) self addMenuPar_withDef("main_powerups", "Lose Points Team", ::GivePowerUp, "lose_points_team"); if (isDefined(level.zombie_include_powerups["lose_perk"])) self addMenuPar_withDef("main_powerups", "Lose Perk", ::GivePowerUp, "lose_perk"); if (isDefined(level.zombie_include_powerups["empty_clip"])) self addMenuPar_withDef("main_powerups", "Empty Clip", ::GivePowerUp, "empty_clip"); if (isDefined(level.zombie_include_powerups["meat_stink"])) self addMenuPar_withDef("main_powerups", "Meat Stink", ::GivePowerUp, "meat_stink"); if (isDefined(level.zombie_include_powerups["the_cure"])) self addMenuPar_withDef("main_powerups", "The Cure", ::GivePowerUp, "the_cure"); if (isDefined(level.zombie_include_powerups["blue_monkey"])) self addMenuPar_withDef("main_powerups", "Blue Monkey", ::GivePowerUp, "blue_monkey"); if (isDefined(level.zombie_include_powerups["green_monkey"])) self addMenuPar_withDef("main_powerups", "Green Monkey", ::GivePowerUp, "green_monkey"); if (isDefined(level.zombie_include_powerups["zombie_blood"])) self addMenuPar_withDef("main_powerups", "Zombie Blood", ::GivePowerUp, "zombie_blood"); } }[/CODE] You can easily copy the Name and the Input and the if check from my list. :D The if checks the powerup status for each powerup. :D Feel free to use it, but give credits :) Regards, CabCon. [/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
Call of Duty: Black Ops 2 Scripts Questions
Call of Duty: Black Ops 2 Answered Questions
How do you spawn power ups? [ZM]
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
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