How to detect if someone is near a spawned object in game?
#9

Quote:
Originally Posted by boelie
Посмотреть сообщение
maybe change this one into IsObjectInRangeOfPlayer...just put a IsPlayerInRangeOfPoint in there somewhere

Код:
stock IsObjectInRangeOfPoint(objectid, Float:range, Float:x, Float:y, Float:z)
{
new
Float:px,
Float:py,
Float:pz;
GetObjectPos(objectid, px, py, pz);
px -= x;
py -= y;
pz -= z;
return ((px * px) + (py * py) + (pz * pz)) < (range * range);
}
Can you explain more into that?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)