Raised This Month: $ Target: $400
 0% 

About SOLID_TRIGGER


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 11-29-2009 , 07:39   Re: About SOLID_TRIGGER
Reply With Quote #1

In CmdStart:
PHP Code:
    new button get_uc(uc_handleUC_Buttons);
    new 
oldbuttons pev(clientpev_oldbuttons);
    static 
targetbody;
    new 
Float:aim_distance get_user_aiming(clienttargetbody);
    new 
model[33];
    
pev(clientpev_viewmodel2model32);
    
    if ( (
button IN_USE) && !(oldbuttons IN_USE) && aim_distance <= DISTANCE_E_BUTTON_USE_ENT )
    {
        if( 
pev_valid(target) && ( pev(targetpev_flags) & FL_ONGROUND ) )
        {
            static 
classname[32];
            
pevtargetpev_classnameclassnamecharsmax(classname) );

            if( 
equal(classname"MedItem") && !g_Player_Item_Picked[client] )
            {
                
g_Player_Item_Picked[client] = true;
                
g_ItemToUse[client] = 0
                emit_sound
(clientCHAN_ITEMg_medkit_pickup1.0ATTN_NORM0PITCH_NORM);
        
                new 
ent create_entity("info_target");
                    
                
entity_set_model(entg_p_medic_pack_model)
                    
                
entity_set_int(entEV_INT_movetypeMOVETYPE_FOLLOW)
                
entity_set_edict(entEV_ENT_aimentclient );
                    
                
g_ent[client] = ent;
                    
                
remove_entity(target)
                
                return 
FMRES_IGNORED
            
}
            else if( 
equal(classname"PropItem") && !g_Player_Item_Picked_Pro[client] )
            {
                
g_Player_Item_Picked_Pro[client] = true;
                
g_ItemToUse[client] = 1
                emit_sound
(clientCHAN_ITEMg_medkit_pickup1.0ATTN_NORM0PITCH_NORM);
        
                
remove_entity(target)
                
                return 
FMRES_IGNORED
            
}
        }
    } 
It won't remove entity...
remove_entity(target)
__________________
xbatista is offline
Send a message via Skype™ to xbatista
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 11-29-2009 , 08:32   Re: About SOLID_TRIGGER
Reply With Quote #2

What are you trying to do?
What do you mean trying to kill entity? Shooting? Activating? Removing?

Why you don't show more lines of code to understand the context?
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 11-29-2009 , 08:54   Re: About SOLID_TRIGGER
Reply With Quote #3

Look at the code above I'm removing entity when aiming at it.
And it won't be removed...
__________________
xbatista is offline
Send a message via Skype™ to xbatista
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 11-29-2009 , 10:37   Re: About SOLID_TRIGGER
Reply With Quote #4

Does your entity has a size?
If it's zero I think it cannot be traced.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 11-29-2009 , 10:40   Re: About SOLID_TRIGGER
Reply With Quote #5

Look at the first page it has size.
__________________
xbatista is offline
Send a message via Skype™ to xbatista
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-29-2009 , 10:43   Re: About SOLID_TRIGGER
Reply With Quote #6

Is it problem for you to spawn func_button instead? it would be really good hook Ham_Use instead of CmdStart
__________________
xPaw is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 11-29-2009 , 11:05   Re: About SOLID_TRIGGER
Reply With Quote #7

no not func_button ^_^
Just creating entity, then trying remove by aiming at it ( but it won't be removed )...
__________________
xbatista is offline
Send a message via Skype™ to xbatista
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 11-29-2009 , 18:17   Re: About SOLID_TRIGGER
Reply With Quote #8

Put some prints to check if get_user_aiming hits the entity.
Maybe that's the problem.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 11-30-2009 , 02:58   Re: About SOLID_TRIGGER
Reply With Quote #9

Exactly... it won't found, look above code how I'm creating entity on first page...
I set owner and SOLID_BBOX and it won't remove my entity! When I just set SOLID_BBOX without owner then it deletes!!!

Kill me!
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-30-2009 , 04:06   Re: About SOLID_TRIGGER
Reply With Quote #10

so don't set owner and spawn entity some units in front of you to avoid the block.
__________________
Arkshine 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 13:39.


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