09.03.2016, 13:41
warning 208: function with tag result used before definition, forcing reparse![Huh?](images/smilies/confused.gif)
![Huh?](images/smilies/confused.gif)
PHP код:
forward Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
public Float:SetPlayerToFacePos(playerid, Float:X, Float:Y)
{
new
Float:pX,
Float:pY,
Float:pZ,
Float:ang;
if(!IsPlayerConnected(playerid)) return 0.0;
GetPlayerPos(playerid, pX, pY, pZ);
if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
else ang = (floatabs(ang) - 180.0);
ang += 180.0;
SetPlayerFacingAngle(playerid, ang);
return ang;
}