05.08.2016, 09:13
Add this somewhere in your script but remember, NOT UNDER ANY CALLBACKS! Just anywhere. Hope it works.
Advice: Use IsPlayerInRangeOfPoint instead of using this one. It's faster and easier to use.
Advice: Use IsPlayerInRangeOfPoint instead of using this one. It's faster and easier to use.
Код:
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z) { new Floatldposx, Floatldposy, Floatldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } return 0; }