30.12.2011, 12:19
What script makes player position one point forward?
new Float:x, Float:y, Float:z, Float:ang; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, ang); SetPlayerPos(playerid, x+10, y, z); SetPlayerFacingAngle(playerid, ang)
if (!strcmp(cmdtext, "/Test")) { new Float:fPX, Float:fPY, Float:fPZ, Float:fVX, Float:fVY, Float:fVZ, Float:object_x, Float:object_y, Float:object_z; const Float:fScale = 5.0; GetPlayerCameraPos(playerid, fPX, fPY, fPZ); GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ); object_x = fPX + floatmul(fVX, fScale); object_y = fPY + floatmul(fVY, fScale); object_z = fPZ + floatmul(fVZ, fScale); SetPlayerPos(playerid, object_x, object_y, object_z); return 1; }