Raised This Month: $ Target: $400
 0% 

Ham_ResetSpeed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-08-2011 , 21:51   Ham_ResetSpeed
Reply With Quote #1

using the following code

PHP Code:
public fwdPlayerResetMaxSpeedPost(id)
{
        new 
iClass g_XP[id][Class];
        new 
iRank g_XP[id][Rank];
        new 
weapon get_user_weapon(id);
    
        if(
iClass == CLASS_NONE)
            return 
HAM_IGNORED;
        
        if(!
weapon)
            return 
HAM_IGNORED;
        
        new 
szWeaponName[32];
        
get_weaponname(weaponszWeaponNamecharsmax(szWeaponName));
            
        
client_print(idprint_chat"[%s] Speed Changed Weapon: %s"g_szPrefixNameszWeaponName);

it prints the previous weapon.. If i currently have AK47 Switch to Glock it prints AK47..

and so every one knows its a post hook. Any ideas why it "resets" before the weapon actually changes??

Also would setting a task be a work around? (Ways to check for rapid switching so not to create 200 set tasks lol)
Doc-Holiday is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-08-2011 , 22:57   Re: Ham_ResetSpeed
Reply With Quote #2

Hook CurWeapon instead.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-08-2011 , 23:06   Re: Ham_ResetSpeed
Reply With Quote #3

Quote:
Originally Posted by hornet View Post
Hook CurWeapon instead.
lmfao i was just told not to use curweap... also there is a bug

when i zoom in cur weapon... it resets my speed back to normal instead of what the gun is set to.
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-08-2011 , 23:28   Re: Ham_ResetSpeed
Reply With Quote #4

Quote:
Originally Posted by hornet View Post
Hook CurWeapon instead.
No, using Ham to reset max speed is the best method.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-08-2011 , 23:42   Re: Ham_ResetSpeed
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
No, using Ham to reset max speed is the best method.
Ideas on how to fix the weapon issue??

as of right now i just removed the weapons part so with my snipers the same speed with all his guns.
Doc-Holiday is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-08-2011 , 23:11   Re: Ham_ResetSpeed
Reply With Quote #6

Who told you not to use CurWeapon? What bug?

Well you could hook Ham_Weapon_SecondaryAttack with each weapon that has a zoom function, and set the speed back to what you want?
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-09-2011 , 03:41   Re: Ham_ResetSpeed
Reply With Quote #7

ResetMaxSpeed is called when you switch weapon after you deploy it.

get_user_weapon is not updated yet at this time. It updates when CurWeapon message is sent.

So, to get the correct weapon name :

- Retrieve your current active weapon with m_pActiveItem offset : weapon = get_pdata_cbase( id, 373 )
- Get the weapon [CSW] Id with the m_iId offset : weaponId = get_pdata_int( weapon, 43, 4 )
- Then, get_weaponname( weaponId, ... )
__________________

Last edited by Arkshine; 08-09-2011 at 03:45.
Arkshine is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-09-2011 , 06:02   Re: Ham_ResetSpeed
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
ResetMaxSpeed is called when you switch weapon after you deploy it.

get_user_weapon is not updated yet at this time. It updates when CurWeapon message is sent.

So, to get the correct weapon name :

- Retrieve your current active weapon with m_pActiveItem offset : weapon = get_pdata_cbase( id, 373 )
- Get the weapon [CSW] Id with the m_iId offset : weaponId = get_pdata_int( weapon, 43, 4 )
- Then, get_weaponname( weaponId, ... )
THANKS.. will give it a shot

Where do you get these offsets from??

Last edited by Doc-Holiday; 08-09-2011 at 06:07.
Doc-Holiday is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-09-2011 , 06:24   Re: Ham_ResetSpeed
Reply With Quote #9

Quote:
Originally Posted by Doc-Holiday View Post
THANKS.. will give it a shot

Where do you get these offsets from??
HLDSK i guess.
__________________

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
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-09-2011 , 06:37   Re: Ham_ResetSpeed
Reply With Quote #10

Quote:
Originally Posted by Doc-Holiday View Post
Where do you get these offsets from??
Those offsets have been collected/searched from some years so we all have kind of list on our computers
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-09-2011 at 13:58.
ConnorMcLeod is offline
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 03:21.


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