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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tag mismatch (/showthread.php?tid=158613)



Tag mismatch - MJ! - 10.07.2010

pawn Код:
public TextDrawShowHideForPlayer(playerid,Text:textdraw,time){
    SetTimerEx("HideTextdraw",time*1000,false,"dd",playerid,Text:textdraw); } /* HERE - TAG MISMATCH */
It shows me Tag Mismatch, but the script working good ... why ?


Re: Tag mismatch - ViruZZzZ_ChiLLL - 10.07.2010

pawn Код:
SetTimerEx("HideTextdraw",time*1000,false,"dd",playerid);



Re: Tag mismatch - MJ! - 10.07.2010

no, lol ... because i have to hide the textdraw from my parameter, lol

playerid,Text:textdraw,time

Because HideTextdraw has 2 parameters: playerid,Text:textdraw


Re: Tag mismatch - DeathOnaStick - 10.07.2010

Quote:
Originally Posted by MJ!
Посмотреть сообщение
no, lol ... because i have to hide the textdraw from my parameter, lol

playerid,Text:textdraw,time

Because HideTextdraw has 2 parameters: playerid,Text:textdraw
Remove the "Text:", i think its not needed.

pawn Код:
public TextDrawShowHideForPlayer(playerid,Text:textdraw,time){SetTimerEx("HideTextdraw",time*1000,false,"dd",playerid,textdraw); }
I guess its just needed when declaring the variable.


Re: Tag mismatch - MJ! - 10.07.2010

yea, i tryed without it, same thing


Re: Tag mismatch - DeathOnaStick - 10.07.2010

Quote:
Originally Posted by MJ!
Посмотреть сообщение
yea, i tryed without it, same thing
pawn Код:
public TextDrawShowHideForPlayer(playerid,Text:textdraw,time){SetTimerEx("HideTextdraw",time*1000,false,"ds",playerid,textdraw); }
Would this work?
If not, i would not know more that could help, yet.


Re: Tag mismatch - MJ! - 10.07.2010

nop, didn't worked


Re: Tag mismatch - Mauzen - 10.07.2010

I think you cannot give Textdraws as Parameters for SetTimerEx. You could try to make a global variable for this, e.g. an array with one field for every player, so you can use this in the timer and do not have to give it as parameter,


Re: Tag mismatch - MJ! - 10.07.2010

no... i don't think so ... if i need the textdraw ID , and i do this:

pawn Код:
new ID = textdraw;
It give the same warning, Tag Mismatch ...


Re: Tag mismatch - Mauzen - 10.07.2010

Yes, you would have to use a TextDraw array, so e.g. add this to your global variables:

new Text:draws[MAX_PLAYERS];

In TextDrawShowHideForPlayer save the textdraw in there:

draws[playerid] = textdraw;

Then you can use draws[playerid] in HideTextdraw. Only negative aspect would be, you can only have one Textdraw per player at the same time, or draws will be overwritten and the old one does not hide.