errors
#1

Код:
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);
Reply


Messages In This Thread
errors - by Karolukas123 - 19.02.2016, 16:38
Re: errors - by nezo2001 - 19.02.2016, 17:20
Re: errors - by Karolukas123 - 19.02.2016, 20:20
Re: errors - by Vince - 19.02.2016, 20:31
Re: errors - by Karolukas123 - 19.02.2016, 20:35
Re: errors - by Trucido - 19.02.2016, 23:45
Re: errors - by Karolukas123 - 20.02.2016, 07:42

Forum Jump:


Users browsing this thread: 1 Guest(s)