AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block +use (https://forums.alliedmods.net/showthread.php?t=171526)

Diegorkable 11-07-2011 06:41

Block +use
 
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?

TheArmagedon 11-07-2011 09:12

Re: Block +use
 
PHP Code:

if(get_user_button(index) & IN_USE) {
// command


This should work.

Snaker beatter 11-07-2011 09:14

Re: Block +use
 
in the function

add code:

PHP Code:

if (get_user_button(id) & IN_USE)
        return 
HAM_SUPERCEDE 


Diegorkable 11-07-2011 09:27

Re: Block +use
 
In the RegisterHam? it says undefined symbol "get_user_button"

TheArmagedon 11-07-2011 09:28

Re: Block +use
 
lol...
do this in the "function" command

Snaker beatter 11-07-2011 09:28

Re: Block +use
 
show me your included files

Devil259 11-07-2011 09:35

Re: Block +use
 
Hook Ham_Use then block it.

Diegorkable 11-07-2011 10:18

Re: Block +use
 
Did it, didnt work, it returns ham_supercede but doesnt block it

Devil259 11-07-2011 12:54

Re: Block +use
 
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.

Diegorkable 11-07-2011 13:23

Re: Block +use
 
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


All times are GMT -4. The time now is 12:15.

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