30.10.2014, 20:17
I don't quite understand what you're asking but if you're looking to get the coordinates a certain distance in front of the player's position this function is extremely useful:
Here's an example of how you could use it:
Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { new Float:a; GetPlayerPos(playerid, x, y, a); GetPlayerFacingAngle(playerid, a); if (GetPlayerVehicleID(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), a); } x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); }
Код:
new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 4.0);