Raised This Month: $ Target: $400
 0% 

how to get if one player is too close to another ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
noob
Junior Member
Join Date: Jun 2004
Old 02-27-2005 , 15:15   how to get if one player is too close to another ?
Reply With Quote #1

this is what i got so far

Code:
public check_dist() {
	new players[32], inum
	get_players(players,inum,"a")
	new player[32], anum
	get_players(player,anum,"a")
	for(new i = 0 ;i < inum ;++i) {
		new origin[3]
		get_user_origin(players[i], origin, 0)
		for(new a = 0 ;a < anum ;++a) {
			new vorigin[3], distance
			get_user_origin(player[a], vorigin, 0)
			distance = get_distance(origin,vorigin)

			if(distance < 90) {
				do_something()
			}
		}
	}
	return PLUGIN_CONTINUE
}
and in the plugin_init, there is
Code:
 set_task(0.1, "check_dist", 0, "", 0, "b")
noob 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 14:03.


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