21.06.2014, 21:10
I use this:
and return this:
EDIT:
Example::
Player ID 0 it's connected!.
pawn Код:
public OnCursorPositionChange(NewX, NewY)
{
if(var == 1)
{
new Float:p[3];
new Float:MX = (floatdiv(NewX, ScreenWidth) * 640.0);
new Float:MY = (floatdiv(NewY, ScreenHeight) * 448.0);
ScreenToWorld(0, MX, MY, p[0], p[1], p[2]);
new Float:pp[3];
//GetObjectPos(obj, pp[0], pp[1], pp[2]);
SetObjectPos(obj, p[0], p[1], p[2]);
//printf("%f, %f, %f", p[0], p[1], p[2]);
}
return 1;
}
pawn Код:
[23:33:39] 0.114388, -1.017790, 0.300795
[23:33:39] 0.116575, -1.017659, 0.298849
[23:33:39] 0.119490, -1.017521, 0.296903
[23:33:39] 0.121676, -1.017390, 0.294958
[23:33:40] 0.120220, -1.017570, 0.297876
[23:33:40] 0.118034, -1.017812, 0.301767
[23:33:40] 0.117305, -1.017819, 0.301767
...
...
EDIT:
Example::
pawn Код:
ScreenToWorld(0, 600, 200, p[0], p[1], p[2]);
returns: 0.998540, -0.610018, -0.094856