Hi, I need the function PlayerToPoint to compare the position of the player from the one indicated by me.
I converted the code from Sa-Mp at MTA but 'not to be in command I used said that the position I have chosen, but it is not true .. You place the code:
function PlayerToPoint(radi, source, X, Y, Z)
local oldposx, oldposy, oldposz = getElementPosition(source);
outputDebugString("Ext X: "..tostring(X).." Y: "..tostring(Y).." Z: "..tostring(Z).." RADIUS: "..tostring(radi).."");
outputDebugString("Player X: "..tostring(oldposx).." Y: "..tostring(oldposy).." Z: "..tostring(oldposz).."");
local tempposx = oldposx - X;
local tempposy = oldposy - Y;
local tempposz = oldposz - Z;
if (((tempposx < radi) and (tempposx > -radi)) and ((tempposy < radi) and (tempposy > -radi)) and ((tempposz < radi) and (tempposz > -radi))) then
return 1;
else
return 0;
end
end
What's wrong?