Count TextDraws
#1

I want to count my created TextDraws, so i made this:


Код:
new  count_TextDraws;

#define 	TextDrawCreate     	TextDrawCreateEx
#define 	TextDrawDestroy   	TextDrawDestroyEx

stock TextDrawCreateEx(Float:tdX, Float:tdY, text[])
{
    count_TextDraws++;
    return TextDrawCreate(tdX, tdY, text);
}

stock TextDrawDestroyEx(tdid)
{
    count_TextDraws--;
    return TextDrawDestroy(tdid);
}
Код:
//...
printf(" TextDraws: %d / %d", count_TextDraws, MAX_TEXT_DRAWS);
But i have this warnings here:

Код:
(12911) : warning 213: tag mismatch
(12921) : warning 213: tag mismatch
(12931) : warning 213: tag mismatch
(12940) : warning 213: tag mismatch
(12950) : warning 213: tag mismatch
(12958) : warning 213: tag mismatch
(12966) : warning 213: tag mismatch
(12978) : warning 213: tag mismatch
(12991) : warning 213: tag mismatch
(13002) : warning 213: tag mismatch
(13013) : warning 213: tag mismatch
(13029) : warning 213: tag mismatch
(13030) : warning 213: tag mismatch
(13031) : warning 213: tag mismatch
(13032) : warning 213: tag mismatch
(13033) : warning 213: tag mismatch
(13034) : warning 213: tag mismatch
(13035) : warning 213: tag mismatch
(13036) : warning 213: tag mismatch
(13038) : warning 213: tag mismatch
(13039) : warning 213: tag mismatch
(13041) : warning 213: tag mismatch
(13042) : warning 213: tag mismatch
(13044) : warning 213: tag mismatch
(13045) : warning 213: tag mismatch
(18534) : warning 213: tag mismatch

26 Warnings.
All the lines have a TextDrawCreate, for example 12911:

Код:
Uhrzeit = TextDrawCreate(547.000000, 22.000000, " ");
Anyone an idea?

Thanks!
Reply
#2

Try this:
pawn Код:
new  count_TextDraws;

#define     TextDrawCreate      TextDrawCreateEx
#define     TextDrawDestroy     TextDrawDestroyEx

stock Text:TextDrawCreateEx(Float:tdX, Float:tdY, text[])
{
    count_TextDraws++;
    return TextDrawCreate(tdX, tdY, text);
}

stock TextDrawDestroyEx(Text:tdid)
{
    count_TextDraws--;
    return TextDrawDestroy(tdid);
}
Reply
#3

Thanks, but there is a problem with the TextDrawCreate.. He wont create a textdraw, the server dont crash or anything, but he stops there and do not load other things..

If i delete the 2 #define's, it works again.

I have in my OnGameModeInit:

Код:
LoadTimer();
LoadTextDraws();
LoadVehicles();
LoadPVehicles();
So he loads Timer, but no TextDraws, no Vehicles, No PVehicles... He stops there.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)