open.mp forum
[Pawn] Help: warning 213 tag mismatch - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Help: warning 213 tag mismatch (/showthread.php?tid=1553)



Help: warning 213 tag mismatch - Behemoth - 2021-01-19

Heyo,



recently got back into scripting, and trying to create a function.



"function:SetPlayerCamera(playerid)"



When I compile, I get warning "warning 213: tag mismatch: expected tag "Function", but found none ("_")"



It seems to be with the tag "function", but when I remove it, it works fine. This only seems to be an issue in the new compiler, but I'm struggling to understand why. Could someone please explain what this warning actually means and what best practice would be?



cheers,


RE: Help: warning 213 tag mismatch - Pinch - 2021-01-19

That's NOT how you are supposed to create a function.



Code:
tag:function()

{

    return tag; // i.e. false if bool:function

}

You don't need a tag if you won't use it.


RE: Help: warning 213 tag mismatch - Behemoth - 2021-01-19

(2021-01-19, 06:37 PM)Pinch Wrote: That's NOT how you are supposed to create a function.



Code:
tag:function()

{

? ? return tag; // i.e. false if bool:function

}

You don't need a tag if you won't use it.



Thanks, I last programmed PAWN like 3/4 years ago. I was following a tutorial which added tags, hence the confusion.