[Support] Disable Function (Damage) of Grenades and Tacticals
-
Hello Guys!
I´m trying to disable the Damage of Schockcharges, Semtex, Flashbangs ... but its not working with my corrent Script, can someone help!?
Extract from the script: (onPlayerDamage)
if ( StrTok(sWeapon, "_")[0] == "frag_grenade" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "concussion_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "sticky_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "willy_pete_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "hatchet_mp" ) { iDamage = 100; } if ( StrTok(sWeapon, "_")[0] == "sensor_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "bouncingbetty_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "emp_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "satchel_charge_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "proximity_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "claymore_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "pda_hack_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "trophy_system_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "flash_grenade_mp" ) { iDamage = 0;THANKS

-
What you're actually interested in, is the
smeansofdeathparamater.
With it, you match against damage types.
Here are a few ones that should get you pretty far.
MOD_GRENADE_SPLASH
MOD_IMPACT
MOD_GAS
MOD_EXPLOSIVE
You can find more by e.g. justiprintlning the parameter and then testing all kinds of damage.onplayerdamage(einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime) { if(smeansofdeath == "MOD_GRENADE_SPLASH" || smeansofdeath == "MOD_IMPACT" || smeansofdeath == "MOD_GAS" || smeansofdeath == "MOD_EXPLOSIVE") idamage = 0; return idamage; }But really, this is probably for trickshotting? Maybe just allow damage from the weapon class sniper, and ignore everything else?
-
What you're actually interested in, is the
smeansofdeathparamater.
With it, you match against damage types.
Here are a few ones that should get you pretty far.
MOD_GRENADE_SPLASH
MOD_IMPACT
MOD_GAS
MOD_EXPLOSIVE
You can find more by e.g. justiprintlning the parameter and then testing all kinds of damage.onplayerdamage(einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime) { if(smeansofdeath == "MOD_GRENADE_SPLASH" || smeansofdeath == "MOD_IMPACT" || smeansofdeath == "MOD_GAS" || smeansofdeath == "MOD_EXPLOSIVE") idamage = 0; return idamage; }But really, this is probably for trickshotting? Maybe just allow damage from the weapon class sniper, and ignore everything else?
Ox_ said in Disable Function (Damage) of Grenades and Tacticals:
But really, this is probably for trickshotting? Maybe just allow damage from the weapon class sniper, and ignore everything else?
How would I do this?
-
Hello Guys!
I´m trying to disable the Damage of Schockcharges, Semtex, Flashbangs ... but its not working with my corrent Script, can someone help!?
Extract from the script: (onPlayerDamage)
if ( StrTok(sWeapon, "_")[0] == "frag_grenade" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "concussion_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "sticky_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "willy_pete_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "hatchet_mp" ) { iDamage = 100; } if ( StrTok(sWeapon, "_")[0] == "sensor_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "bouncingbetty_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "emp_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "satchel_charge_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "proximity_grenade_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "claymore_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "pda_hack_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "trophy_system_mp" ) { iDamage = 0; } if ( StrTok(sWeapon, "_")[0] == "flash_grenade_mp" ) { iDamage = 0;THANKS

You are splitting the weapon string by every
_take the first element and then compare it against a string that has an_, that is why your code is not and will never work.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login