24.10.2010, 17:22
A New GetXYZInFrontOfPlayer?
Exist a Function similar at this for Get NOT the Front Point Central of Player, but a little Side (Right / Left) ?
Exist a Function similar at this for Get NOT the Front Point Central of Player, but a little Side (Right / Left) ?
Код:
forward GetXYZInFrontOfPlayer(playerid, &Float:x, &Float:y, &Float:z, Float:distance);
public GetXYZInFrontOfPlayer(playerid, &Float:x, &Float:y, &Float:z, Float:distance) {
new Float:a; GetPlayerFacingAngle(playerid, a);
GetPlayerVelocity(playerid, x, y, z);
if (GetPlayerVehicleID(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees)); }


)
, &Float:y, &Float:z, Float:distance);