Raised This Month: $51 Target: $400
 12% 

[....]


Post New Thread Reply   
 
Thread Tools Display Modes
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-26-2011 , 13:12   Re: Player Speed
Reply With Quote #11

Ham_Item_PreFrame works but it is called every frame, so it does not differ with anyway for setting the speed in player think assuming the item think is called not depending on the item action. Ham_CS_Player_ResetMaxSpeed is obviously called only when the speed is changed. It is not in the official module though, but as far as I remember you can get it working with the official as well, just have to use another function.
SnoW is offline
Send a message via MSN to SnoW
bibu
Veteran Member
Join Date: Sep 2010
Old 07-26-2011 , 13:45   Re: Player Speed
Reply With Quote #12

So you could just do this if I am right.

PHP Code:
#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

RegisterHam(Ham_Player_ResetMaxSpeed"player""Player_ResetMaxSpeed"1
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-26-2011 , 14:42   Re: Player Speed
Reply With Quote #13

Quote:
Originally Posted by bibu View Post
So you could just do this if I am right.

PHP Code:
#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

RegisterHam(Ham_Player_ResetMaxSpeed"player""Player_ResetMaxSpeed"1
You could, but why would you ( isn't that just confusing )? I already gave you much more efficient way to do this.
SnoW is offline
Send a message via MSN to SnoW
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-26-2011 , 15:16   Re: Player Speed
Reply With Quote #14

And how can we do that with the original Module provided with AMXx 1.8.1 ?
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
eXtrem
Member
Join Date: Jul 2011
Old 07-26-2011 , 16:05   Re: Player Speed
Reply With Quote #15

Quote:
Originally Posted by abdul-rehman View Post
And how can we do that with the original Module provided with AMXx 1.8.1 ?
Quote:
Originally Posted by bibu View Post
So you could just do this if I am right.

PHP Code:
#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

RegisterHam(Ham_Player_ResetMaxSpeed"player""Player_ResetMaxSpeed"1
@bibu : Yes, you are right.
eXtrem is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-26-2011 , 17:13   Re: Player Speed
Reply With Quote #16

Quote:
Originally Posted by SnoW View Post
You could, but why would you ( isn't that just confusing )? I already gave you much more efficient way to do this.
Ham_Item_PreFrame is the same as Ham_Player_ResetMaxSpeed when hooked for player classname.
Since Ham_Player_ResetMaxSpeed is not defined in the latest AMXX (only in the new version of HamSandwich by joaquim/Arkshine/etc. which still isn't finished), then why not use Ham_Player_ResetMaxSpeed defined as Ham_Item_PreFrame?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-26-2011 , 17:33   Re: Player Speed
Reply With Quote #17

Quote:
Originally Posted by Exolent[jNr] View Post
Ham_Item_PreFrame is the same as Ham_Player_ResetMaxSpeed when hooked for player classname.
Since Ham_Player_ResetMaxSpeed is not defined in the latest AMXX (only in the new version of HamSandwich by joaquim/Arkshine/etc. which still isn't finished), then why not use Ham_Player_ResetMaxSpeed defined as Ham_Item_PreFrame?
Actually Ham_Player_ResetMaxSpeed is currently nothing( notice the CS_ ). I obviously first thought they were going to hook this for an item instead of a player ( hooking for player was never mentioned ). I was aware of the possible usage of other function for this( just like I mentioned ) but I just did not remember it was Ham_Item_PreFrame which lead to the confusion.
SnoW is offline
Send a message via MSN to SnoW
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-26-2011 , 18:09   Re: Player Speed
Reply With Quote #18

Quote:
Originally Posted by SnoW View Post
hooking for player was never mentioned
See the title and everywhere else they are hooking for "player" classnames.
__________________
fysiks is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-27-2011 , 04:52   Re: Player Speed
Reply With Quote #19

So when is Ham_Item_Preframe called ? On weapons switches ?
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-27-2011 , 05:45   Re: Player Speed
Reply With Quote #20

Quote:
Originally Posted by fysiks View Post
See the title and everywhere else they are hooking for "player" classnames.
The title has nothing to do with the game class of the forward. The title simply tells we are going to change player speed and that is what I understood in the first place ( I never thought we were going to change the weapon's speed if this is still not clear ). The unclear part was if they were going to change the player speed in an item or a player forward. The only forward here hooked for player is Ham_Spawn, I cannot imagine it's game class would be related to the Ham_Item_Preframe or Ham_CS_Player_ResetMaxSpeed either.
Quote:
Originally Posted by abdul-rehman View Post
So when is Ham_Item_Preframe called ? On weapons switches ?
When you hook it for an item it is called every item's frame, somehow I am not sure if it is actually called every frame across all items' lives, or is there some unactive moments, probably better to test it yourself. You cannot actually hook the item preframe function for a player ( that would not make sense as a player does not actually have that function in the game ), but the offset ( is this a right term? ) with Ham_Item_PreFrame is the same as the function of changing player's speed ( named currently Ham_CS_Player_ResetMaxSpeed ), so when hooking for a player this forward it is called every time the engine tries to change the player's speed. So because player's speed is changed in a weapon switch, this is how probably called on that occasion too.
SnoW is offline
Send a message via MSN to SnoW
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode