SetTimerEx tag mismatch -
iWhite - 14.06.2015
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);
|
Re: SetTimerEx tag mismatch -
AndySedeyn - 14.06.2015
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", 3000, false, "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.
Re: SetTimerEx tag mismatch -
iWhite - 14.06.2015
Quote:
Originally Posted by AndySedeyn
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.
Re: SetTimerEx tag mismatch -
AndySedeyn - 14.06.2015
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.
Re: SetTimerEx tag mismatch -
Konstantinos - 14.06.2015
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;
}
Re: SetTimerEx tag mismatch -
iWhite - 14.06.2015
Quote:
Originally Posted by Konstantinos
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!
Re: SetTimerEx tag mismatch -
AndySedeyn - 14.06.2015
Quote:
Originally Posted by Konstantinos
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.