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-30-2009 , 04:31   Re: About SOLID_TRIGGER
Reply With Quote #1

I won't spawn in front becouse it will piss a bit velocity adding X or Y or Z.
I tryied set SOLID_BBOX without owner before aiming at it and it doesn't do the trick
__________________
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:33   Re: About SOLID_TRIGGER
Reply With Quote #2

Quote:
I won't spawn in front becouse it will piss a bit velocity adding X or Y or Z.
I don't understand what you mean, can you say in another way, please ?
__________________
Arkshine is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 11-30-2009 , 04:40   Re: About SOLID_TRIGGER
Reply With Quote #3

Try by youself create this entity from player and you will see it will piss entity's velocity by increasing X Y Z entity origin
fOrigin[2] += fAngle[2] + 30.0;

Just look at the sky and throw it, you will see that it won't throw.

PHP Code:
public Create_Items_Propane_Throw(id

    new 
FloatfOrigin[3], Float:fAngle[3],FloatfVelocity[3]; 

    
entity_get_vectoridEV_VEC_originfOrigin); 
    
entity_get_vectoridEV_VEC_view_ofsfAngle); 

    
fOrigin[0] += fAngle[0]; 
    
fOrigin[1] += fAngle[1]; 
    
fOrigin[2] += fAngle[2] + 30.0
     
    
fm_velocity_by_aim(id0.6fVelocityfAngle); 
    
fAngle[0] *= -1.0
     
    new 
item_ent create_entity("info_target"); 

    
entity_set_stringitem_entEV_SZ_classname"PropItem"); 
     
    
entity_set_modelitem_entg_w_medic_propane); 
     
    
entity_set_floatitem_entEV_FL_takedamage1.0); 
    
entity_set_floatitem_entEV_FL_health20.0); 
     
    
entity_set_vectoritem_entEV_VEC_originfOrigin); 

    
fOrigin[0] += fVelocity[0]; 
    
fOrigin[1] += fVelocity[1]; 
    
fOrigin[2] += fVelocity[2]; 
     
    
entity_set_intitem_entEV_INT_solidSOLID_BBOX
    
entity_set_intitem_entEV_INT_movetypeMOVETYPE_TOSS
     
    
entity_set_floatitem_entEV_FL_gravity0.55); 
     
    
fVelocity[0] *= 1000.0
    
fVelocity[1] *= 1000.0
    
fVelocity[2] *= 1000.0

    
entity_set_vectoritem_entEV_VEC_velocityfVelocity); 
    
entity_set_vectoritem_entEV_VEC_anglesfAngle); 
     
    
entity_set_size(item_entFloat:{-3.5, -5.5, -8.5}, Float:{3.55.58.5}) 
     
    
set_task(0.5"Set_Back_Model"id); 

__________________

Last edited by xbatista; 11-30-2009 at 04:42.
xbatista is offline
Send a message via Skype™ to xbatista
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-30-2009 , 08:50   Re: About SOLID_TRIGGER
Reply With Quote #4

Quote:
Originally Posted by xbatista View Post
Try by youself create this entity from player and you will see it will piss entity's velocity by increasing X Y Z entity origin
fOrigin[2] += fAngle[2] + 30.0;

Just look at the sky and throw it, you will see that it won't throw.
It's not like that you should do.

Code:
pev( Player, pev_origin, Origin ); pev( Player, pev_v_angle, Angles ); angle_vector( Angles, ANGLEVECTOR_FORWARD, Forward ); xs_vec_mul_scalar( Forward, 150.0, Forward ); xs_vec_add( Origin, Forward, Origin );

With the view angle, you can get the direction "forward". (normal vector)
Once you have it, you scale by the length you want.
Then you add to your current origin.

The result is the entity will have its start origin on x units in front of where player aims.
__________________
Arkshine is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 11-30-2009 , 09:19   Re: About SOLID_TRIGGER
Reply With Quote #5

Can you combine it with my code please? It's cofusing :/
__________________
xbatista is offline
Send a message via Skype™ to xbatista
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-03-2009 , 06:44   Re: About SOLID_TRIGGER
Reply With Quote #6

Bumper :0
Please ark combine it with my code I'm bad at maths :///
__________________
xbatista is offline
Send a message via Skype™ to xbatista
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 11-30-2009 , 08:39   Re: About SOLID_TRIGGER
Reply With Quote #7

I don't know really but maybe get_user_aiming (what uses traceline with player entity as ignored entity ) can't detect entities within the same owner as the player (?).

Btw, you can use manually

- trace_line
- trace_hull
- EngFunc_TraceModel (this is the best way I think)
__________________

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 , 08:44   Re: About SOLID_TRIGGER
Reply With Quote #8

Quote:
Originally Posted by joropito View Post
I don't know really but maybe get_user_aiming (what uses traceline with player entity as ignored entity ) can't detect entities within the same owner as the player (?).

Btw, you can use manually

- trace_line
- trace_hull
- EngFunc_TraceModel (this is the best way I think)
My method good, also it won't remove when damage goes < 1.0, it won't explode, I know the problem, but don't know how to fix, it's problem with SOLIDS :/
Also I don't want to change X Y Z origins in above code, becouse of #23.
PHP Code:
// init
RegisterHamHam_TakeDamage"info_target""Fwd_DamageEnt" );

// forward
public Fwd_DamageEnt(entinflictorattackerFloat:damagedamagebits)
{
    if( !
pev_valid(ent) || !is_user_connected(attacker) ) return HAM_IGNORED;
    
    new 
Float:fOrigin[3], iOrigin[3], FloatTorigin[3], FloatDistanceFloatDamage;
    
entity_get_vectorentEV_VEC_originfOrigin);
    
    new 
Classname[32];
    
entity_get_stringentEV_SZ_classnameClassnamecharsmax(Classname) );
    
    if( !
equal (Classname"PropItem") )
        return 
HAM_IGNORED
    
    
if ( damagebits DMG_HEGRENADE || get_user_weapon(attacker) == CSW_KNIFE )
    {
        
SetHamParamFloat(40.0);
        return 
HAM_HANDLED;
    }
    
    if ( 
entity_get_floatentEV_FL_health) - damage 1.0 )
    {
        
iOrigin[0] = floatround(fOrigin[0])
        
iOrigin[1] = floatround(fOrigin[1])
        
iOrigin[2] = floatround(fOrigin[2])
                
        
message_begin(MSG_BROADCAST,SVC_TEMPENTITYiOrigin)
        
write_byte(TE_EXPLOSION)
        
engfuncEngFunc_WriteCoord,fOrigin[0])
        
engfuncEngFunc_WriteCoord,fOrigin[1])
        
engfuncEngFunc_WriteCoord,fOrigin[2])
        
write_short(explodespr)
        
write_byte(35)
        
write_byte(20)
        
write_byte(0)
        
message_end()
            
        for(new 
enemy 1enemy <= g_max_clientsenemy++) 
        {
            if ( 
is_user_alive(enemy) && get_user_team(attacker) != get_user_team(enemy) && attacker != enemy)
            {
                
entity_get_vectorenemyEV_VEC_originTorigin)
                    
                
Distance get_distance_f(fOriginTorigin)
                    
                if ( 
Distance <= get_pcvar_float(propane_explo_radius) )
                {
                    
Damage = (((Distance get_pcvar_float(propane_explo_radius)) * get_pcvar_float(propane_explo_dmg)) - get_pcvar_float(propane_explo_dmg)) * -1.0;
                        
                    if ( 
Damage 0.0 )
                    {
                        
ExecuteHam(Ham_TakeDamageenemyg_iGrenadeattackerDamageDMG_HEGRENADE);
                    }
                }
            }
        }
    }
    
    return 
HAM_IGNORED;

__________________

Last edited by xbatista; 11-30-2009 at 08:49.
xbatista is offline
Send a message via Skype™ to xbatista
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