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

ham item deploy being a piece of shit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 06-13-2014 , 15:07   ham item deploy being a piece of shit
Reply With Quote #1

So I'm trying to set maxspeed with the newly aquired forward and it's just not working
I made sure it's post and not pre, still, I need a goddamn task because setspeed is called before the user's speed is set to weapon speed

waterfuck? any workaround or I'll have to create tens of tasks

RegisterHam( Ham_Item_Deploy, "weapon_knife", "fwReplaceKnifeModels", 1);

okay, so to add some more detail, I've basically removed the entire part of the item deploy that handles maxspeed, moved it into a new function, and am now calling it 0.1 seconds after ham_item_deploy. It's working but the delay is noticable, and I'm also worried it might malfunction.

Why is this happening? Is there any other workaround? I didn't have this problem with curweapon...

Last edited by aron9forever; 06-13-2014 at 15:27. Reason: details
aron9forever is offline
r0ck
Senior Member
Join Date: Jun 2011
Location: India
Old 06-13-2014 , 15:50   Re: ham item deploy being a piece of shit
Reply With Quote #2

well there is a function for resetting player max speed if you could search...

PHP Code:
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

public plugin_init()
    
RegisterHam(Ham_Player_ResetMaxSpeed"player""PlayerResetMaxSpeed"1)

public 
PlayerResetMaxSpeed(id)
        
set_user_maxspeed(id400.0// whatever speed u want 
__________________
Preparing to release my plugins..
r0ck is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 06-13-2014 , 20:30   Re: ham item deploy being a piece of shit
Reply With Quote #3

Ham_Item_Deploy is the wrong tool for the job. Hamsandwhich can't be a piece of shit because it simply hooks into existing engine functions and makes them available to you. Don't fault it for choosing the wrong one.

Ham_CS_Player_ResetMaxSpeed has been added for AMXX 1.8.3 and I would recommend using that. The alternative by r0ck is also correct for AMXX 1.8.2 and below as it uses the same vtable offset.
The description for Ham_Item_PreFrame says that it might run on every frame, but in CS it doesn't.

And please stop it with your pointless bashing of tasks...
__________________
In Flames we trust!
Nextra is offline
Reply


Thread Tools
Display Modes

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 11:35.


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