SA-MP Forums Archive
What's wrong here... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What's wrong here... (/showthread.php?tid=281339)



What's wrong here... - Whizion - 05.09.2011

pawn Код:
stock GetOppositeAngle(Float:angle)
{
    if(angle < 180.0) { return angle + 180.0; } // warning 213: tag mismatch
    return angle - 180.0; // warning 213: tag mismatch
}
Please help, thanks.


Re: What's wrong here... - JaTochNietDan - 05.09.2011

Quote:
Originally Posted by Whizion
Посмотреть сообщение
pawn Код:
stock GetOppositeAngle(Float:angle)
{
    if(angle < 180.0) { return angle + 180.0; } // warning 213: tag mismatch
    return angle - 180.0; // warning 213: tag mismatch
}
Please help, thanks.
You need to declare the stock using a float tag as it is returning a float. Additionally you don't need those extra brackets

pawn Код:
stock Float: GetOppositeAngle(Float:angle)
{
    if(angle < 180.0) return angle + 180.0; // warning 213: tag mismatch
    return angle - 180.0; // warning 213: tag mismatch
}



Re: What's wrong here... - Whizion - 05.09.2011

Thanks.