 |
|
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
|

12-05-2010
, 00:49
Re: Distances and units
|
#5
|
Quote:
Originally Posted by BigMac
PHP Code:
public Something(id)
{
if (GetDistanceFromGround(id) == 2)
{
client_print(0, print_chat, "testing");
}
}
GetDistanceFromGround(id)
{
// Check if player is on ground?
// if (entity_get_int(client, EV_INT_flags) & FL_ONGROUND)
// return 0;
new Float:clientOrigin[3], Float:groundOrigin[3];
entity_get_vector(id, EV_VEC_origin, clientOrigin);
//drop_to_floor(id);
entity_get_vector(id, EV_VEC_origin, groundOrigin);
entity_set_origin(id, clientOrigin);
return floatround(vector_distance(clientOrigin, groundOrigin));
}
Why doesn't this work then?
I jump up and didn't get that message and when i jump down or fell down i still didn't get that message!
|
The odds of you being able to use that command when you're exactly 2 units from the ground are slim. Try checking a range rather than an exact unit amount.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
|
|
|
|