16.10.2016, 18:07
Good evening, ok, so I wanted to create a function which is detecting on which degree is player aiming, so I found the way to create it with sin and cos, but when I am trying to return a float of angle I get warning. So I did it in two versions I will post both but I don`t know what is problem, in both is same warning:
Warning:
PHP код:
stock GetPlayerAimingPoint(playerid, Float:Angle)
{
new Float:X, Float:Y, Float:Z; //Float:Angle;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
X += (5 * floatsin(-Angle, degrees));
Y += (5 * floatcos(-Angle, degrees));
return Angle;//Warning Line
}
//Version 2
stock GetPlayerAimingPoint(playerid, Float:Angle)
{
new Float:X, Float:Y, Float:Z; //Float:Angle;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
X += (5 * floatsin(-Angle, degrees));
Y += (5 * floatcos(-Angle, degrees));
return Float:Angle;//warning Line
}
Код:
warning 213: tag mismatch