Raised This Month: $32 Target: $400
 8% 

[Help] Hook Slot5 and Slot6


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 04-27-2014 , 07:15   [Help] Hook Slot5 and Slot6
Reply With Quote #1

I want to hook slot5 and slot6
My idea is making [5] and [6] as skill buttons, not change weapon slot

I saw in a cs mod, they can do it, but i dont see the code
I tried this code and failed:
PHP Code:
public plugin_init()
{
    
register_plugin("Test""1.0""Dias")
    
register_clcmd("slot5""Slot5")
}

public 
Slot5(id)
{
    
client_print(idprint_chat"Skill Activated")

dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-27-2014 , 07:50   Re: [Help] Hook Slot5 and Slot6
Reply With Quote #2

It may be very simple and i am just really wrong with this, but here are my thoughts.
Few days i ago i was testing some commands and I made output for every command client_command() forward catches. When I press number 3 for instance, it catches weapon_knife command. So they *maybe* put some weapons in those slots with different weapon data so they can hook it like this.
As i said, I may be wrong, but this is a possible way I can see.

EDIT:
You could also display an empty menu with keys bitsum you want to detect, so I believe you could catch all numbers(0-9). Only problem here is when they open different menu. Maybe activate that invisible menu if they have no other menu open(there is a offset for this called m_iMenu i think) in PreThink(maybe a bad method, but that is first thing on my mind right now).

Last edited by klippy; 04-27-2014 at 07:54.
klippy is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-27-2014 , 08:28   Re: [Help] Hook Slot5 and Slot6
Reply With Quote #3

Problem with hooking, for example, weapon_knife as slot3 is that it only works when the weapon is actually selected. If you have hud_fastswitch 0, it will not work until you press mouse1.

Constantly showing a menu will prevent you to use any other slot buttons, even if you only register MENU_KEY_5 and 6 as buttons for it.
__________________
Black Rose is offline
Old 04-27-2014, 10:16
.Dare Devil.
This message has been deleted by .Dare Devil..
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 04-30-2014 , 02:18   Re: [Help] Hook Slot5 and Slot6
Reply With Quote #4

I play CS BTE, even i set hud_fastswich 0, i still can active skill when pressing Slot5 and Slot6
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-30-2014 , 08:16   Re: [Help] Hook Slot5 and Slot6
Reply With Quote #5

CS BTE is a completely custom client which can have this feature included.

You're out of luck with server-side coding only.

Hook flashlight and drop instead, they're better for skills anyway.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
m4m3ts
Senior Member
Join Date: Jun 2012
Old 05-02-2014 , 19:30   Re: [Help] Hook Slot5 and Slot6
Reply With Quote #6

yea, that's server side i think.
m4m3ts 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 23:55.


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