一定要动作吗?
不用动作直接设置坐标的话:
forward GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
public GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{ // Created by Y_Less
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));
}
//调用部分,已获取xy坐标的情况下
GetXYInFrontOfPlayer(playerid,x,y,-1.0);