Count TextDraws - 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: Count TextDraws (
/showthread.php?tid=294115)
Count TextDraws -
Nikolas-Mrak - 31.10.2011
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!
Re: Count TextDraws - [L3th4l] - 31.10.2011
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);
}
Re: Count TextDraws -
Nikolas-Mrak - 31.10.2011
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.