View Single Post
Author Message
quilhos
Veteran Member
Join Date: Jun 2010
Old 12-27-2014 , 00:17   Block touch in entities
Reply With Quote #1

I'm trying to block a spectator player to touch on certain amount of entities in the server
Examples
Code:
opening a door 
pick up weapons
touching a button
touch a football ball
pick up presents from the ground
Sound - USE FUNCTION (when the spectator players use "E" the other players in Terrorist / CT dont hear the sound of him using E)
As far as I tried I come up with this, but I have little understanding of the func_ and the classnames of the entities.

PHP Code:
    RegisterHam(Ham_Touch"weaponbox""blocked_entity");
    
RegisterHam(Ham_Touch"armoury_entity""blocked_entity");
    
RegisterHam(Ham_Touch"weapon_shield""blocked_entity");
    
    
RegisterHam(Ham_Touch"func_wall""blocked_entity");
    
RegisterHam(Ham_Use"func_button""blocked_entity");
    
RegisterHam(Ham_Touch"func_door""blocked_entity");
    
RegisterHam(Ham_Touch"func_door_rotation""blocked_entity");
    
RegisterHam(Ham_Touch"func_touchable""blocked_entity"); 
blocked entity public function
PHP Code:
public blocked_entity(weapon,id)
{
    if(!
is_user_connected(id))
        return 
HAM_IGNORED
        
    
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        return 
HAM_SUPERCEDE
        
    
return HAM_IGNORED;

Note
Code:
Use buttons - working
PickUp weapons - working
touching a button - working
opening a door - working
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!

Last edited by quilhos; 12-27-2014 at 15:39.
quilhos is offline