05.05.2014, 08:15
Hey there, i am having a error while compiling "arguement type mismatch ( type 2 ) in the following line, expect help from you guys.
Code:
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); // here is the error. 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; }