AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   ham item deploy being a piece of shit (https://forums.alliedmods.net/showthread.php?t=242076)

aron9forever 06-13-2014 15:07

ham item deploy being a piece of shit
 
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...

r0ck 06-13-2014 15:50

Re: ham item deploy being a piece of shit
 
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 


Nextra 06-13-2014 20:30

Re: ham item deploy being a piece of shit
 
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...


All times are GMT -4. The time now is 21:11.

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