PDA

View Full Version : Disabling damage if player uses wrong weapon



EvoloZz
15th March 2013, 16:33
Hey, I need to know how can I disable damage to the player if the attacker is using wrong weapon, for example if he needs to bash but he shoots at the victim.
I think functions like isFiring() and isLookingAt() would help me do it, but whats the function to disable damage to the player that is being looked at, everything else I know already :P
Thanks in advance.

Ni3ls
15th March 2013, 16:43
if(sMeansofDeath != "MOD_MELEE")
iDamage=0;

IzNoGoD
15th March 2013, 18:37
please use return; instead of idamage = 0;, as idamage gets checked further along the way.

Earliboy
15th March 2013, 19:04
You want to make an bashmode?


if(getCvar("scr_bash") == "1" && sMeansOfDeath != "MOD_MELEE")
return;

Also if u just want to prevent damage on some weapons as example:


if(sWeapon == "mp44_mp")
return;


Also if you want to do like headshot does x2 or x3 damage, you can do the same


if(sHitLoc == "head" && sWeapon == "thompson_mp")
iDamage = iDamage * 3;


There are much ways how you can play with the damage thread, same way works if u want to prevent suicide with bazooka or grenades. Just test it out :)

EvoloZz
15th March 2013, 20:05
I have a bashmode already made, but atm it just removes ammo so I want to improve it to prevent bugs.
Thanks for help guys :)