Raised This Month: $ Target: $400
 0% 

Block +use


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-07-2011 , 06:41   Block +use
Reply With Quote #1

Hey guys,

I want to block +use button so I registered RegisterHam(Ham_ObjectCaps, "player", "function")

in the function "function" I return HAM_SUPERCEDE, and for some reason its not blocking. What do I need to do in order to block the +use button?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 11-07-2011 , 09:12   Re: Block +use
Reply With Quote #2

PHP Code:
if(get_user_button(index) & IN_USE) {
// command

This should work.

Last edited by TheArmagedon; 11-07-2011 at 09:13.
TheArmagedon is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-07-2011 , 09:14   Re: Block +use
Reply With Quote #3

in the function

add code:

PHP Code:
if (get_user_button(id) & IN_USE)
        return 
HAM_SUPERCEDE 
__________________

Last edited by Snaker beatter; 11-07-2011 at 09:15.
Snaker beatter is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-07-2011 , 09:27   Re: Block +use
Reply With Quote #4

In the RegisterHam? it says undefined symbol "get_user_button"
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
TheArmagedon
Senior Member
Join Date: Sep 2010
Location: Unknown Source
Old 11-07-2011 , 09:28   Re: Block +use
Reply With Quote #5

lol...
do this in the "function" command
TheArmagedon is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-07-2011 , 09:28   Re: Block +use
Reply With Quote #6

show me your included files
__________________
Snaker beatter is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-07-2011 , 09:35   Re: Block +use
Reply With Quote #7

Hook Ham_Use then block it.
Devil259 is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-07-2011 , 10:18   Re: Block +use
Reply With Quote #8

Did it, didnt work, it returns ham_supercede but doesnt block it
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-07-2011 , 12:54   Re: Block +use
Reply With Quote #9

Code:
#include < amxmodx > #include < hamsandwich > public plugin_init( ) {      RegisterHam( Ham_Use , "player" , "fw_PlayerUse" , 1 ) } public fw_PlayerUse( id ) {      // if( condition )      // {                return HAM_SUPERCEDE      // } }

Untested.
Devil259 is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-07-2011 , 13:23   Re: Block +use
Reply With Quote #10

Did it but it didnt work, had to add also "func_button" hook for Ham_Use, then it blocks. But I cant get the one who activated it's team, it blocks for T and CT the usage of buttons, I did: if (get_user_button(id) & IN_USE && cs_get_user_team(id) == CS_TEAM_T) then return SUPERCEDE.

The problem is that it always returns SUPERCEDE even if its a CT
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable 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 05:32.


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