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:


PHP Code:







public FwdTraceLine(Float:start[3], Float:end[3], conditionsidtrace)
{    
    if (!
is_user_alive(id) && is_user_connected(id) && get_user_flags(id) & ADMIN_SLAY)
    {
        new 
target get_tr2(traceTR_pHit)        
        if (
pev_valid(target))
        {
            static 
classname[32]
            
pev(targetpev_classnameclassnamecharsmax(classname))
            if (
equal(classname"Mine") || equal(classname
"FakeC4"))
            {
                static 
ownerownername[32]
                
owner pev(targetpev_owner)
                
get_user_name(ownerownernamecharsmax(ownername))
          &nb sp;     
client_print(idprint_center"This %s belongs to %s."classnameownername)
            }
        }
    }










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:


PHP Code:







public FwdAddToFullPack_Post(es_handleeenthosthostflagsplayerpSet)
{
    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(entpev_classnameclassnamecharsmax(classname))
            if (
equal(classname"Mine") || equal(classname"FakeC4"))
            {
             & nbsp;  
set_es(es_handleES_RenderModekRenderNormal)
            }
        }
    }










Thanks!


Orignal From: Get when user is aiming at SOLID_TRIGGER

No comments

Not a single link is allowed to submit in comment :o