#1

Well... I wanted to make my own function for absolute value and so I did... Now, the pawn compiler returned a warning saying:

Код:
F:\ZGM.pwn(169) : warning 213: tag mismatch
Line 169 is the line return val;
Here is the code:
Код:
#include <a_samp>
forward abs(Float:val);
public abs(Float:val)
{
	if(val < 0.0)
	{
	    val = val * (-1.0);
	}
	return val;
}
I wonder why?

Thanks
Reply
#2

As this function is supposed to return a float number, it should be like this:

pawn Код:
stock Float:abs(Float:val)
{
    if(val < 0.0)
    {
        val = val * (-1.0);
    }
    return val;
}
Reply
#3

Thanx xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)