ItsMods
buttons and keys - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: buttons and keys (/Thread-buttons-and-keys.html)

Pages: 1 2


buttons and keys - godil - 01-05-2011

Can you please tell how to make when you press a certain key, given weapons and perks

sorry for my bad englishBig Grin


RE: bottons and keys - prisma - 01-05-2011

Somewhere in your code:
PHP Code:
doWeapons() { self endon("disconnect"); self endon("death"); for(;;) { if(self secondaryOffhandButtonPressed()) { self giveWeapon( "crossbow_explosive_mp" ); //Gives the Crossbow self switchToWeapon( "crossbow_explosive_mp" ); //switch to the Crossbow } wait 0.05; } }

Then add in your onPlayerspawned()
PHP Code:
self thread doWeapons();

Not tested but should work Wink
It gives you a crossbow when you press X


RE: bottons and keys - d0h! - 01-05-2011

prisma is right, this should work without any problems

tutorials can be found here
http://www.itsmods.com/forum/Forum-Modding-Tutorials.html


RE: bottons and keys - master131 - 01-06-2011

uhm sorry prisma thats for MW2 not Black Ops and anyway, you did a mistake. Should be self waittill("X"); Also, since you didn't put self endon("death"); the loop is going to pile on top of each other everytime your spawn.

Try this instead:
PHP Code:
doWeapons() { self endon("disconnect"); self endon("death"); for(;;) { if(self secondaryOffhandButtonPressed()) { self giveWeapon( "crossbow_explosive_mp" ); //Gives the Crossbow switchToWeapon( "crossbow_explosive_mp" ); //switch to the Crossbow } wait 0.05; } }

secondaryOffhandButtonPressed = your smoke button which is normally 4. All the actionslot buttons only work for the host for some reason.


RE: bottons and keys - d0h! - 01-06-2011

oh yeh lol, old mw2 scripts confusing me sometimes


RE: bottons and keys - prisma - 01-06-2011

(01-06-2011, 02:11)master131 Wrote: uhm sorry prisma thats for MW2 not Black Ops and anyway, you did a mistake. Should be self waittill("X"); Also, since you didn't put self endon("death"); the loop is going to pile on top of each other everytime your spawn.
So there is no notifyonplayercommand anymore ?
Didn't try modding on BO cause i need a new BO acc Big Grin
Wrote it just out of my mind x)

ps: Edited my first Post


RE: bottons and keys - godil - 01-06-2011

(01-06-2011, 02:11)master131 Wrote: uhm sorry prisma thats for MW2 not Black Ops and anyway, you did a mistake. Should be self waittill("X"); Also, since you didn't put self endon("death"); the loop is going to pile on top of each other everytime your spawn.

secondaryOffhandButtonPressed = your smoke button which is normally 4. All the actionslot buttons only work for the host for some reason.

yeah, it's work)
but you missed "self" in "switchToWeapon":
PHP Code:
self switchToWeapon( "crossbow_explosive_mp" ); //switch to the Crossbow



RE: bottons and keys - master131 - 01-07-2011

yeah, lol. I just blindly c&P without noticing. Dodgy


RE: buttons and keys - godil - 01-07-2011

See, I have a zombie with ballistic knives...
how to make that they cannot pick up another weapon?
i have a some code, but it's not work
PHP Code:
zombiecheck() { self endon( "death" ); if( self getcurrentweapon() == "m1911_mp") if( self getcurrentweapon() == "commando_mp") if( self getcurrentweapon() == "python_speed_mp") if( self getcurrentweapon() == "spas_mp") if( self getcurrentweapon() == "makarov_upgradesight_extclip_mp") if( self getcurrentweapon() == "hk21_extclip_mp") if( self getcurrentweapon() == "skorpion_grip_extclip_silencer_mp") if( self getcurrentweapon() == "psg1_vzoom_extclip_mp") { self takeAllWeapons(); self giveWeapon( "knife_ballistic_mp", 5, false ); self switchToWeapon("knife_ballistic_mp"); } }

anyone can help?


RE: buttons and keys - prisma - 01-07-2011

PHP Code:
zombiecheck() { self endon( "death" ); if( self getcurrentweapon() != "knife_ballistic_mp") // != means is not... So if the weapon isnt the knife it will switch the weapon { self takeAllWeapons(); self giveWeapon( "knife_ballistic_mp", 5, false ); self switchToWeapon("knife_ballistic_mp"); } wait 0.05; }

Maybe ? I dont know if it works...