Raised This Month: $ Target: $400
 0% 

follow players aim


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-07-2010 , 06:18   follow players aim
Reply With Quote #1

Someone can make that the rocket on follow zombies body or head?

Code:
public find_and_follow(info[]) 
{
	new zp_jp_rocket = info[0]
	new Float:shortestDist = 10000.0
	new nearestPlayer = 0
	
	if (is_valid_ent(zp_jp_rocket)) 
	{
		new players[32], count
		get_players(players, count)
		for (new i = 0; i < count; i++) 
		{
			if (is_user_alive(players[i]) && (entity_get_edict(zp_jp_rocket, EV_ENT_owner) != players[i]) && (get_user_team(players[i]) != get_user_team(entity_get_edict(zp_jp_rocket, EV_ENT_owner)))) 
			{
				new Float:PlayerOrigin[3], Float:RocketOrigin[3]
				entity_get_vector(players[i], EV_VEC_origin, PlayerOrigin)
				entity_get_vector(zp_jp_rocket, EV_VEC_origin, RocketOrigin)
				
				new Float:distance = vector_distance(PlayerOrigin, RocketOrigin)
				
				if (distance <= shortestDist) 
				{
					shortestDist = distance
					nearestPlayer = players[i]
				}
			}
		}
	}
Vechta is offline
 


Thread Tools
Display Modes

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 07:05.


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