warning 208: function with tag result used before definition, forcing reparse
#1

Help-me to fix it!

Error line:
bool:IsPlayerAimingAtPlayer(playerid, target)

Error
warning 208: function with tag result used before definition, forcing reparse

Код:
bool:IsPlayerAimingAtPlayer(playerid, target) // warning 208: function with tag result used before definition, forcing reparse
{
        new Float:x, Float:y, Float:z;
        GetPlayerPos(target, x, y, z);
        if (IsPlayerAimingAt(playerid, x, y, z-0.75, 0.25)) return true;
        if (IsPlayerAimingAt(playerid, x, y, z-0.25, 0.25)) return true;
        if (IsPlayerAimingAt(playerid, x, y, z+0.25, 0.25)) return true;
        if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
        return false;
}
Reply
#2

It means that you access/use the function before it's defined.

I would move the whole function to the top of the script, or before the line where you call the function.
Reply
#3

dont use bool for such functions, there is no need for it.
Reply
#4

Tags are significantly underused. If applied well then a tag mismatch warning will easily alert you to any mistakes you have made while typing your code.

But yeah, you can either move it to the top of the script (or put it in an include), or you can forward the function (same way you would do a public function) and put it anywhere.
Reply
#5

ty you guys!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)