When entity is tossed up ( above player ) the server crashes without any errors, when I changed entity solid type to _TRIGGER it works fine but I can't pick it up or do damage to it.
PHP Code:
public throwstick( id ) {
new Float:Origin[ 3 ], Float:Velocity[ 3 ], Float:Angles[ 3 ], Float:FAngles[ 3 ];
entity_get_vector( id, EV_VEC_origin, Origin );
velocity_by_aim( id, 64, Angles )
vector_to_angle( Angles, FAngles );
FAngles[ 0 ] = 0.0;
Origin[ 0 ] += Angles[ 0 ];
Origin[ 1 ] += Angles[ 1 ];
Origin[ 2 ] += Angles[ 2 ];
new entity_stick = create_entity( "info_target" );
entity_set_string( entity_stick, EV_SZ_classname, entity_name );
entity_set_vector( entity_stick, EV_VEC_angles, FAngles );
entity_set_int( entity_stick, EV_INT_solid, SOLID_BBOX );
entity_set_int( entity_stick, EV_INT_movetype, MOVETYPE_TOSS );
entity_set_origin( entity_stick, Origin );
entity_set_model( entity_stick, gModel );
entity_set_size( entity_stick, minModel, maxModel );
entity_set_float( entity_stick, EV_FL_takedamage, 1.0 );
entity_set_float( entity_stick, EV_FL_gravity, 0.8 );
entity_set_float( entity_stick, EV_FL_health, get_pcvar_float( stick_health ) );
set_pev( entity_stick, pev_iuser2, id );
entity_set_int( entity_stick, EV_INT_renderfx, kRenderFxGlowShell );
entity_set_vector( entity_stick, EV_VEC_rendercolor, Float:{ 221.0, 173.0, 237.0 } );
velocity_by_aim( id, 600, Velocity );
entity_set_vector( entity_stick, EV_VEC_velocity, Velocity );
has_stick[ id ] = false;
}