SetTimerEx tag mismatch
#1

Hi.

I would like to know how to pass tags in timers? Because I always get tag mismatch, when I, for example, try to use Textdraws variables like this:

Quote:

SetTimerEx("EndOfTD", 3000, false, "iii", playerid, PlayerText:td, PlayerText:td2);

Reply
#2

Why would you use textdraws as a parameter of that timer? Create the timer for playerid, and delete the textdraws within the body of the timer's function.

PHP Code:
SetTimerEx("EndOfTD"3000false"i"playerid);
forward EndOfTD(playerid);
public 
EndOfTD(playerid)
{
    
// Delete the textdraws here
    
return 1;

Plus, textdraws are not an integer, boolean, floating integer, string or any other data type. It is an on-screen object.
Reply
#3

Quote:
Originally Posted by AndySedeyn
View Post
Why would you use textdraws as a parameter of that timer? Create the timer for playerid, and delete the textdraws within the body of the timer's function.

[php]
SetTimerEx("EndOfTD", 3000, false, "i", playerid);

forward EndOfTD(playerid);
public EndOfTD(playerid)
{
// Delete the textdraws here

return 1;
}
[/ph

Plus, textdraws are not an integer, boolean, floating integer, string or any other data type. It is an on-screen object.
Because this system deletes textdraw when player gets xp after 3sec, so if player will get another xp after previous before timer deletes textdraw, new textdraw will be deleted and the old one will not be deleted.
Reply
#4

My given example above should do the job. You delete the new ones and keep the old ones. Perfectly possible. What is not possible is what you did, textdraws are not an integer value for all I know. They're on-screen object.
Reply
#5

The textdraw IDs are integers and what iWhite is asking for is possible:
pawn Code:
SetTimerEx("EndOfTD", 3000, false, "ii", playerid, _:td);
pawn Code:
forward EndOfTD(playerid, PlayerText:td);
public EndOfTD(playerid, PlayerText:td)
{
    PlayerTextDrawDestroy(playerid, td);
    return 1;
}
Reply
#6

Quote:
Originally Posted by Konstantinos
View Post
The textdraw IDs are integers and what iWhite is asking for is possible:
pawn Code:
SetTimerEx("EndOfTD", 3000, false, "ii", playerid, _:td);
pawn Code:
forward EndOfTD(playerid, PlayerText:td);
public EndOfTD(playerid, PlayerText:td)
{
    PlayerTextDrawDestroy(playerid, td);
    return 1;
}
YES! I was looking for this! Thanks Konstantinos!
Reply
#7

Quote:
Originally Posted by Konstantinos
View Post
The textdraw IDs are integers and what iWhite is asking for is possible:
pawn Code:
SetTimerEx("EndOfTD", 3000, false, "ii", playerid, _:td);
pawn Code:
forward EndOfTD(playerid, PlayerText:td);
public EndOfTD(playerid, PlayerText:td)
{
    PlayerTextDrawDestroy(playerid, td);
    return 1;
}
In that case I have learned something new. Thank you and I'd like to apologise to iWhite.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)