Solved knockback factor on guns

Installation Problems Support
Post Reply
Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

knockback factor on guns

#1

Post by Rain1153 » 5 years ago

Can we set knockback of default guns like in zp?
LOL

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#2

Post by czirimbolo » 5 years ago

it would be nice if we could set something like this: higher level = more powerful knockback
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#3

Post by Raheem » 5 years ago

Yes, you can search for any plugin that change weapons default knockback. It should work without problems with our Mod.
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#4

Post by Rain1153 » 5 years ago

czirimbolo wrote: 5 years ago it would be nice if we could set something like this: higher level = more powerful knockback
I can try it if i find that plugin
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#5

Post by Rain1153 » 5 years ago

But there is a default zm knockback factor on ze what about it?
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#6

Post by Rain1153 » 5 years ago

https://forums.alliedmods.net/showthread.php?t=165075
i tried this one well it worked when zm weren't released but when they were released! the knockback factors from ze.cfg was automatically used any fixes?
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#7

Post by Raheem » 5 years ago

The knockback we add is addtion to the original one, we don't replace old one by ours. Still based on weapons. You can try: ze_zombie_knockback 1.0

One more thing, in ze_core.sma you may need to remove this line: set_member(iVictim, m_flVelocityModifier, 1.0)

You can also at Fw_TakeDamage_Post() (ze_core.sma) remove the extra knockback.
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#8

Post by Rain1153 » 5 years ago

didnt work
You can also at Fw_TakeDamage_Post() (ze_core.sma) remove the extra knockback. tried this then the normal mod came up lol
also i didnt get this
set_member(iVictim, m_flVelocityModifier, 1.0)
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#9

Post by Raheem » 5 years ago

If you need to disable the Mod knockback:

1. Go to ze_core.sma and then find:
    1. public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
    2. {
    3.     // Not Vaild Victim or Attacker so skip the event (Important to block out bounds errors)
    4.     if (!is_user_connected(iVictim) || !is_user_connected(iAttacker))
    5.         return HC_CONTINUE
    6.    
    7.     // Set Knockback here, So if we blocked damage in TraceAttack event player won't get knockback (Fix For Madness)
    8.     if (g_bIsZombie[iVictim] && !g_bIsZombie[iAttacker])
    9.     {
    10.         // Remove Shock Pain
    11.         set_member(iVictim, m_flVelocityModifier, 1.0)
    12.        
    13.         // Set Knockback
    14.         static Float:flOrigin[3]
    15.         get_entvar(iAttacker, var_origin, flOrigin)
    16.         Set_Knockback(iVictim, flOrigin, get_pcvar_float(g_pCvarZombieKnockback), 2)
    17.     }
    18.    
    19.     return HC_CONTINUE
    20. }
Replace it with:
    1. public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
    2. {
    3.     // Not Vaild Victim or Attacker so skip the event (Important to block out bounds errors)
    4.     if (!is_user_connected(iVictim) || !is_user_connected(iAttacker))
    5.         return HC_CONTINUE
    6.    
    7.     // Set Knockback here, So if we blocked damage in TraceAttack event player won't get knockback (Fix For Madness)
    8.     if (g_bIsZombie[iVictim] && !g_bIsZombie[iAttacker])
    9.     {
    10.         // Remove Shock Pain
    11.         //set_member(iVictim, m_flVelocityModifier, 1.0)
    12.        
    13.         // Set Knockback
    14.         //static Float:flOrigin[3]
    15.         //get_entvar(iAttacker, var_origin, flOrigin)
    16.         //Set_Knockback(iVictim, flOrigin, get_pcvar_float(g_pCvarZombieKnockback), 2)
    17.     }
    18.    
    19.     return HC_CONTINUE
    20. }
Compile and try.
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#10

Post by Rain1153 » 5 years ago

can we make it affect crocuhed zm too? but a little lessened!
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#11

Post by Raheem » 5 years ago

This what Set_Knockback() stock does but you don't need it.
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#12

Post by Rain1153 » 5 years ago

and sv crashes sometimes reason: Segmentation fault (core dumped)
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#13

Post by Raheem » 5 years ago

This edit cannot crash the server, maybe the plugin u added.

U speak generally that ur server crashing or after this edit?
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#14

Post by Rain1153 » 5 years ago

yeah it crashed as soon as the map changed after the edit but nothing is happening now thanks
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#15

Post by Raheem » 5 years ago

So this issue resolved?
He who fails to plan is planning to fail

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#16

Post by Rain1153 » 5 years ago

Yes if i find a problem i'll make you know
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#17

Post by Rain1153 » 5 years ago

raheem humans can shoot zms before the realease of zms can u help?
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#18

Post by Rain1153 » 5 years ago

@raheem
LOL

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 7 guests