Warning Fix
#3

Quote:
Originally Posted by Clarck
View Post
#pragma unused z
That's pretty bad practice to do.

Best solution is to figure out if you actually need to use the z variable.
If not, then remove it from the script/function.
If you do, then ignore the warning until you actually have finished writing the code that actually utilizes the variable.

pawn Code:
stock Get2DZoneFromCoordinates(Float:x, Float:y, zone[], len = sizeof(zone))
{
    for(new i = 0; i != sizeof(gSAZones); i++ )
    {
        if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
        {
            return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
        }
    }
}
    return 0;
This would be the solution, if you aren't going to need the z variable, which you most likely wont considering its a 2D function.
Reply


Messages In This Thread
Warning Fix - by Trevor Gin - 12.03.2015, 15:11
Re: Warning Fix - by Clarck - 12.03.2015, 15:14
Re: Warning Fix - by oliverrud - 12.03.2015, 18:20

Forum Jump:


Users browsing this thread: 1 Guest(s)