How to properly reset user speed ?
I've just bumped into some old code that I had searched help for and since it was never finished I put a little time in it and came with a "beta version" that it's working well...
My problem is that I want to know if I did it right and if I can improve/strip the code or use less modules to achieve the same result. First problem I've bumped in it was that the player speed was not reset after using CS_SET_NO_ZOOM function on him... So I want to know if there is a better way to reset user speed to "unscoped" default weapon speed after using this func. Code:
#include <amxmodx> |
Re: How to properly reset user speed ?
The best way is that : http://forums.alliedmods.net/showpos...2&postcount=11 ( calling Ham_Player_ResetMaxSpeed )
|
Re: How to properly reset user speed ?
So...
PHP Code:
??? .... I can't really understand this... it isn't working... I'm such a noob lol... |
Re: How to properly reset user speed ?
He said call it, not hook it.
PHP Code:
|
Re: How to properly reset user speed ?
ExecuteHamB( Ham_Player_ResetMaxSpeed, id );
Anyway, about your code, if you want to remove the zoom when you do +attack, just make a check in PrimaryAttack, why are you using PostFrame ? |
Re: How to properly reset user speed ?
Quote:
Also I don't need FUN module any more :mrgreen: Thanx for help and fast replying. It's working perfect now and I'm so happy with this code :mrgreen: :mrgreen: :mrgreen: Edit: One more question: Does Hamsandwich has a function that can replace "cs_set_user_zoom( id , CS_SET_NO_ZOOM , 1 );" from cstrike ? Quote:
This was the original thread: ClickMe And this might be the answer to your question: Quote:
|
Re: How to properly reset user speed ?
Still it would be better to do the check in PrimaryAttack. I don't see the need to use a forward called all the time instead of a forward called only when you fire.
|
Re: How to properly reset user speed ?
Quote:
|
Re: How to properly reset user speed ?
Hooking Ham_Weapon_PrimaryAttack and keeping only the fov check. It would be even more appropriate to prefer the VEN's method hooking the shot event.
|
Re: How to properly reset user speed ?
Quote:
PHP Code:
|
All times are GMT -4. The time now is 18:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.