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

How to Detect Slot number Pressing?


Post New Thread Reply   
 
Thread Tools Display Modes
Kinsi
Senior Member
Join Date: Apr 2013
Old 07-25-2017 , 09:51   Re: How to Detect Slot number Pressing?
Reply With Quote #11

Quote:
Originally Posted by inklesspen View Post
I think we can hook without OnPlayerRunCmd... How? I don't know
Nope you cant, tried the same. Slot0-9 is clientside by the looks.
Kinsi is offline
NC.svtrade
Senior Member
Join Date: Nov 2015
Old 07-26-2017 , 21:45   Re: How to Detect Slot number Pressing?
Reply With Quote #12

Quote:
Originally Posted by 0xBatuhan View Post
what your game?
TF2
NC.svtrade is offline
NC.svtrade
Senior Member
Join Date: Nov 2015
Old 07-26-2017 , 21:46   Re: How to Detect Slot number Pressing?
Reply With Quote #13

Quote:
Originally Posted by inklesspen View Post
On forward of SDKTools, "OnPlayerRunCmd", you ran compare int &weapon with otherweapons. (weapon isn't nextweapon, weapon is weapon of slot that was been pressed... For hook via OnPlayerRunCmd you need non-empty slot.)

For hook button 3
PHP Code:
public Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat vel[3], float angles[3], int &weaponint &subtypeint &cmdnumint &tickcountint &seedint mouse[2])
{
    if(
weapon != 0)
    {
        if(
GetPlayerWeaponSlot(2) == weapon)
        {
            
//do something
        
}
    }

I think we can hook without OnPlayerRunCmd... How? I don't know
How About SDKHook_OnWeaponSwitch
NC.svtrade is offline
inklesspen
Member
Join Date: Nov 2015
Location: Russia, Moscow
Old 07-27-2017 , 05:39   Re: How to Detect Slot number Pressing?
Reply With Quote #14

Quote:
Originally Posted by NC.svtrade View Post
How About SDKHook_OnWeaponSwitch
Yes, we can. But if client already switched to this weapon, you can't hook this.

I think... we can hook "use" command
__________________
Mai inglish is veri gud!

Last edited by inklesspen; 07-27-2017 at 05:48.
inklesspen is offline
Send a message via Skype™ to inklesspen
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 07-27-2017 , 14:16   Re: How to Detect Slot number Pressing?
Reply With Quote #15

Quote:
Originally Posted by inklesspen View Post
Yes, we can. But if client already switched to this weapon, you can't hook this.
IIRC SDKHook_WeaponCanSwitchTo will hook on to the current weapon and any other weapons that the player switches to.
__________________

Last edited by Chaosxk; 07-27-2017 at 14:17.
Chaosxk is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-27-2017 , 17:50   Re: How to Detect Slot number Pressing?
Reply With Quote #16

Quote:
Originally Posted by Chaosxk View Post
IIRC SDKHook_WeaponCanSwitchTo will hook on to the current weapon and any other weapons that the player switches to.
This would detect mouse scroll and +use to pick up items.
__________________
Neuro Toxin is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 07-28-2017 , 01:14   Re: How to Detect Slot number Pressing?
Reply With Quote #17

Quote:
Originally Posted by Neuro Toxin View Post
This would detect mouse scroll and +use to pick up items.
Ooooooooh, oops. Guess i need to fix some stuff lol.
__________________
Chaosxk 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 08:44.


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