19.02.2016, 16:38
Код:
warning 209: function "GetPlayerTheoreticAngle" should return a value error 010: invalid function or declaration } //Float:GetPlayerTheoreticAngle(playerid) stock GetPlayerTheoreticAngle(playerid) { new Float:MindAngle = 0.0, Float:angle2 = 0.0; if(IsPlayerConnected(playerid)) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); new Float:dis = floatsqroot(floatpower(floatabs(floatsub(x, Drifting[playerid][pPos][0])), 2)+floatpower(floatabs(floatsub(y, Drifting[playerid][pPos][1])), 2)); if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), angle2); else GetPlayerFacingAngle(playerid, angle2); if(Drifting[playerid][pPos][0] >= x) { new Float:tmp = (x >= Drifting[playerid][pPos][0]) ? (x - Drifting[playerid][pPos][0]) : (Drifting[playerid][pPos][0] - x), Float:sin = asin(tmp / dis); if(Drifting[playerid][pPos][1] >= y) MindAngle = floatadd(floatsub(floatadd(sin, 90), floatmul(sin, 2)), 90.0); else MindAngle = floatsub(floatadd(sin, 180), 180.0); } else { if(Drifting[playerid][pPos][1] < y) { new Float:tmp2 = (y >= Drifting[playerid][pPos][1]) ? (y - Drifting[playerid][pPos][1]) : (Drifting[playerid][pPos][1] - y), Float:sin = acos(tmp2 / dis); MindAngle = floatsub(floatadd(sin, 360), floatmul(sin, 2)); } else { new Float:tmp = (x >= Drifting[playerid][pPos][0]) ? (x - Drifting[playerid][pPos][0]) : (Drifting[playerid][pPos][0] - x), Float:sin = asin(tmp / dis); MindAngle = floatadd(sin, 180); } } } } return (!MindAngle) ? (angle2) : (MindAngle);