Raised This Month: $ Target: $400
 0% 

entity goes to a random direction


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Adomaz1
Senior Member
Join Date: Feb 2014
Old 02-28-2017 , 14:36   entity goes to a random direction
Reply With Quote #1

My entity sometimes goes where the HUD is, and that is what I want, and most of the time it goes to a random direction, what is the problem?

Code:
public MakeRock(id)
{
	new Float:Origin[3], Float:Velocity[3], Float:vAngle[3];
	new RockSpeed = get_pcvar_num(cvar_tank_rock_speed);

	entity_get_vector(id, EV_VEC_origin, Origin);
	entity_get_vector(id, EV_VEC_v_angle, vAngle);

	new NewEnt = create_entity("info_target");

	entity_set_string(NewEnt, EV_SZ_classname, "rock_ent")

	entity_set_model(NewEnt, rock_model)

	entity_set_size(NewEnt, Float:{-1.5, -1.5, -1.5}, Float:{1.5, 1.5, 1.5})

	entity_set_origin(NewEnt, Origin)
	entity_set_vector(NewEnt, EV_VEC_angles, vAngle)
	entity_set_int(NewEnt, EV_INT_solid, 2)

	entity_set_int(NewEnt, EV_INT_movetype, 5)
	entity_set_edict(NewEnt, EV_ENT_owner, id)

	velocity_by_aim(id, RockSpeed  , Velocity)
	entity_set_vector(NewEnt, EV_VEC_velocity ,Velocity)
	
	return PLUGIN_HANDLED
}
Adomaz1 is offline
 



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 20:42.


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