SA-MP Forums Archive
Tag Mismatch - 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: Tag Mismatch (/showthread.php?tid=640877)



Tag Mismatch Error - Primes007 - 08.09.2017

I want to create timers and Textdraws like this:
PHP код:
TextDraw[BaseName1] = CreateTextDraw(X,Y,Z);
TextDraw[BaseName2] = CreateTextDraw(X,Y,Z); 
PHP код:
Timer[TextDrawID] = SetTimer(X,Y,Z); 
But both of them give Tag mismatch errors...any solution?


Re: Tag Mismatch - Primes007 - 08.09.2017

Bump.


Re: Tag Mismatch Error - AmarPlayer - 08.09.2017

The SetTimer function goes like this:
Код:
SetTimer("TimerName", time in miliseconds, repeating); // 1000 miliseconds = 1 second, repeating is false or true.
And isn't it TextDrawCreate?


Re: Tag Mismatch - Misiur - 08.09.2017

Show your "TextDraw" and "Timer" array definitions, and what exactly is "TextDrawID"


Re: Tag Mismatch - Primes007 - 08.09.2017

PHP код:
#define RadarStation 1
new Timer:GZTimer[MAX_TEXT_DRAWS];
new 
Text:TextDraw[RadarStation]
TextDraw[RadarStation] = TextDrawCreate(228.800018379.306640"Radar Station");
GZTimer[TextDraw[RadarStation]] = SetTimerEx("GZCounter",1000,true,"i",TextDraw[RadarStation]);
public 
GZCounter(TextDrawID)
{
     
//statements




Re: Tag Mismatch - Primes007 - 08.09.2017

I just replced the
PHP код:
TextDraw[RadarStation
with playerid in the Timer:
PHP код:
GZTimer[playerid] = SetTimerEx("GZCounter",1000,true,"d",playerid); 
This works fine.

So doesnt the
PHP код:
TextDraw[RadarStation] = TextDrawCreate(228.800018379.306640"Radar Station"); 
return the Text draw id as an integer?

The problem is when I use TextDraw[RadarStation], the parameter is counted as an array(string), which causes the Tag mismatch error.

I still need to find a fix because playerid is not the parameter i need.