Quote:
Originally Posted by Luka™
I made that macro for myself (not for this forum), not gonna use that code what you write.
|
You released it on the forum, thus it's made for this forum. If you only make code for yourself then you can get away with having bugs, but if you're going to release it here you should try and not, and definitely should fix things people point out. For reference, the fixed version of your code (which is no slower the way you use it) is:
pawn Код:
#define pClass(%1) (GetPlayerSkin(playerid)==(%1))
Also, if you want to keep that syntax but make it faster you could do:
pawn Код:
#define pClassInit() new _pClass = GetPlayerSkin(playerid)
#define pClass(%1) (_pClass==(%1))
Then instead of what you're doing at the moment you can do:
pawn Код:
pClassInit();
if(pClass(100) || pClass(200) || pClass(300))
{
SendClientMsg...
gTeam...
Almost identical code (you only need the "pClassInit" once per function) but with the speed benefits of only calling the function once. PLus if you change the macro the compiler will automatically tell you where to change code.