07.01.2018, 20:08
I'm getting 'tag mismatch' warning in this code...
You would probably think why I'd do [CHAR_TEXTDRAW_AGE] instead of [6], so I'll tell you the reason before you even think of that. Readability.
How do I define CHAR_TEXTDRAW_AGE? Well, I've an enumerator in which I've defined it and other similar data. Simple, right?
And I've tried...
nothing helped...
TILL
I used #define instead of defining it in an enumerator and my warnings went away.
---
If you do the same trick as above for something like...
and, use that value in SendClientMessage or another, for example,
. It'll send the message without the value, but if you define it, it'll send the message with MAX_TIME value!
---
So TIL multiple pros of #define and cons of using enumerator. And I'd like to know why or how this happen and more usage tips about them (define and enums).
PHP код:
PlayerTextDrawShow(playerid, pCharCreateTD[playerid][CHAR_TEXTDRAW_AGE]);
How do I define CHAR_TEXTDRAW_AGE? Well, I've an enumerator in which I've defined it and other similar data. Simple, right?
And I've tried...
PHP код:
PlayerTextDrawShow(playerid, _:pCharCreateTD[playerid][_:CHAR_TEXTDRAW_AGE]);
PHP код:
PlayerTextDrawShow(playerid, _:pCharCreateTD[playerid][CHAR_TEXTDRAW_AGE]);
PHP код:
PlayerTextDrawShow(playerid, pCharCreateTD[playerid][_:CHAR_TEXTDRAW_AGE]);
TILL
I used #define instead of defining it in an enumerator and my warnings went away.
---
If you do the same trick as above for something like...
PHP код:
enum
{
MAX_VALUE = 1000,
MAX_TIME = 5
}
PHP код:
SendClientMessage(playerid, -1, "Stand in the red checkpoint for "MAX_TIME" inorder to access it");
---
So TIL multiple pros of #define and cons of using enumerator. And I'd like to know why or how this happen and more usage tips about them (define and enums).