SA-MP Forums Archive
tagof test - 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: tagof test (/showthread.php?tid=437003)



tagof test - MP2 - 13.05.2013

Why does this crash the compiler?:

pawn Код:
new Float:fTest;
if (tagof (fTest) == tagof (Float:)) print("float");
What's the correct way to do this?


Re: tagof test - Djole1337 - 13.05.2013

pawn Код:
new
    Float:myFloat,
    myVar;
myVar = tagof(myFloat);
if (myVar == tagof(Float:))
{
    // do something
}



Re: tagof test - Calabresi - 13.05.2013

I am NOT sure, since I've never been into these parts of water but I guess the correct format (as I learnt from wiki) is:

pawn Код:
new Float:fTest, Float:fTest2;
if (tagof (fTest) == tagof (fTest2)) print("float");
EDIT: Seems like you cannot use tags in tagof() operator. It is for getting tag of something, since you cannot get tag of a tag logically, maybe that's the thing crashes the compiler.


Re: tagof test - MP2 - 13.05.2013

Thanks.