28.11.2013, 21:26
Код:
ProxDetectorS(Float:radi, playerid, targetid) { if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid)) { if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid)) { new Float:posx, Float:posy, Float:posz, Float:oldposx, Float:oldposy, Float:oldposz, Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); GetPlayerPos(targetid, posx, posy, posz); tempposx = (oldposx -posx); tempposy = (oldposy -posy); tempposz = (oldposz -posz); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } } } return 0; }