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
How to change weapon damage? (GSC)
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="TheHiddenHour" data-source="post: 40072" data-attributes="member: 7602"><p>Put [ICODE]level.onplayerdamage = ::onplayerdamage;[/ICODE] in init.</p><p>Put this function somewhere in your project:</p><p>[PHP]onplayerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime )</p><p>{</p><p> // Runs everytime something takes damage</p><p>}[/PHP]</p><p>This is an override function that the game uses in some gamemodes like One In The Chamber, so it's neater to use rather than making your own monitor using waittills. Every time something in the game takes damage, this function will be called on the entity taking damage and its contents will be executed. Here's some psuedo code that could help you with your pack a punch idea <img src="/styles/default/xenforo/smilies.emoji/people/blush.emoji.svg" class="smilie" loading="lazy" alt=":blush:" title="Blush :blush:" data-shortname=":blush:" />:</p><p>[PHP]onplayerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime )</p><p>{</p><p> if(eattacker.has_pap) // If the attacker has a pack-a-punchable weapon equipped</p><p> {</p><p> if(sweapon == "fiveseven_mp") // If the pack-a-punched weapon is a fiveseven</p><p> self.health -= 100; // Subtract 100 health from the victim's health</p><p> }</p><p>}[/PHP]</p></blockquote><p></p>
[QUOTE="TheHiddenHour, post: 40072, member: 7602"] Put [ICODE]level.onplayerdamage = ::onplayerdamage;[/ICODE] in init. Put this function somewhere in your project: [PHP]onplayerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime ) { // Runs everytime something takes damage }[/PHP] This is an override function that the game uses in some gamemodes like One In The Chamber, so it's neater to use rather than making your own monitor using waittills. Every time something in the game takes damage, this function will be called on the entity taking damage and its contents will be executed. Here's some psuedo code that could help you with your pack a punch idea :blush:: [PHP]onplayerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime ) { if(eattacker.has_pap) // If the attacker has a pack-a-punchable weapon equipped { if(sweapon == "fiveseven_mp") // If the pack-a-punched weapon is a fiveseven self.health -= 100; // Subtract 100 health from the victim's health } }[/PHP] [/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
How to change weapon damage? (GSC)
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