Originally Posted by iPLEOMAX
pawn Код:
stock GetXYZInViewOfPlayer(playerid, &Float:X, &Float:Y, &Float:Z, Float:distance) { new Float:VX, Float:VY, Float:VZ; GetPlayerPos(playerid, X, Y, Z); GetPlayerCameraFrontVector(playerid, VX, VY, VZ); X += (distance * VX); Y += (distance * VY); Z += (distance * VZ); }
Just like ******'s GetXYInFrontOfPlayer. But this one uses cam vector for getting coords.
Example Usage:
pawn Код:
CMD:xyztest(playerid, params[]) { new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new object = CreateObject(18647, X, Y, Z, 0, 0, 0, 100);
GetXYZInViewOfPlayer(playerid, X, Y, Z, 10);
MoveObject(object, X,Y,Z, 2); return true; }
|