19.06.2014, 15:34
Ok so basically I've got this working with no errors, however, the direction is blank.
Here's what I'm trying to do:
However it looks like:
Here's segments of the code:
Here's what I'm trying to do:
Код:
[CONTROL]: Vehicle was last seen in Ganton traveling north.
Код:
[CONTROL]: Vehicle was last seen in Ganton traveling .
pawn Код:
stock GetDirection(Float:Angle)
{
new direction[30];
if(350 < Angle <= 10)
{
format(direction, sizeof(direction), "North");
}
else if(10 < Angle <= 80)
{
format(direction, sizeof(direction), "North-East");
}
else if(80 < Angle <= 100)
{
format(direction, sizeof(direction), "East");
}
else if(100 < Angle <= 170)
{
format(direction, sizeof(direction), "South-East");
}
else if(170 < Angle <= 190)
{
format(direction, sizeof(direction), "South");
}
else if(190 < Angle <= 260)
{
format(direction, sizeof(direction), "East-West");
}
else if(260 < Angle <= 280)
{
format(direction, sizeof(direction), "West");
}
else if(280 < Angle <= 350)
{
format(direction, sizeof(direction), "North-West");
}
return direction;
}
new Float:Angle;
GetPlayerFacingAngle(i,Angle);
new zone[MAX_ZONE_NAME];
GetPlayer2DRadarZone(i, zone, sizeof(zone));
format(string, sizeof(string), "{39AACC}[CONTROL]: {FFFFFF}Vehicle was last seen in %s traveling %s.",zone,GetDirection(Angle));