Get when user is aiming at SOLID_TRIGGER
We have this plugin where some players can plant mines. In an attempt to prevent abuse (i.e. allow admins to see who planted a mine in a prohibited location), we have this function:
 
 	
 	
 		
 		
 		
 	
 It used to work just fine. Unfortunately, the mines were blocking ladders, vents and moving doors, so we changed the mine solid type from SOLID_BBOX to SOLID_TRIGGER. Apparently, TraceLine doesn't work with SOLID_TRIGGER objects. Is there any (reasonably fast - it's a big mod) method to indicate to admins who owns a specific mine?
 
If it makes any difference, mines are normally mostly invisible (Alpha 26), except:
 
 	
 	
 		
 		
 		
 	
 Thanks!
PHP Code:
 		
 			
 public FwdTraceLine(Float:start[3], Float:end[3], conditions, id, trace)
{    
    if (!is_user_alive(id) && is_user_connected(id) && get_user_flags(id) & ADMIN_SLAY)
    {
        new target = get_tr2(trace, TR_pHit)        
        if (pev_valid(target))
        {
            static classname[32]
            pev(target, pev_classname, classname, charsmax(classname))
            if (equal(classname, "Mine") || equal(classname, "FakeC4"))
            {
                static owner, ownername[32]
                owner = pev(target, pev_owner)
                get_user_name(owner, ownername, charsmax(ownername))
          &nb  sp;     client_print(id, print_center, "This %s belongs to %s.", classname, ownername)
            }
        }
    }
} 
 
 
 
 		
 		If it makes any difference, mines are normally mostly invisible (Alpha 26), except:
PHP Code:
 		
 			
 public FwdAddToFullPack_Post(es_handle, e, ent, host, hostflags, player, pSet)
{
    if (!is_user_alive(host) && is_user_connected(host) && get_user_flags(host) & ADMIN_SLAY) // see mines
    {
        if (!player && pev_valid(ent))
    ;      {
            static classname[32]
            pev(ent, pev_classname, classname, charsmax(classname))
            if (equal(classname, "Mine") || equal(classname, "FakeC4"))
            {
             &  nbsp;  set_es(es_handle, ES_RenderMode, kRenderNormal)
            }
        }
    }
} 
 
 
 
 		
 		Orignal From: Get when user is aiming at SOLID_TRIGGER
Post a Comment