Box not hide automatically - 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: Box not hide automatically (
/showthread.php?tid=665545)
Box not hide automatically -
MichiCZ - 08.04.2019
Box not hide automatically
Code:
stock ShadInfoBoxForPlayer(playerid, text[])
{
TextDrawHideForPlayer(playerid, ShadInfoBox);
new info[700];
ShadInfoBoxShowing[playerid] = 1;
format(info, sizeof(info), "%s~n~", text);
TextDrawSetString(ShadInfoBox, info);
TextDrawShowForPlayer(playerid, ShadInfoBox);
printf("(%d) Has Just the Shown",playerid);
InfoTimer = SetTimer("InfoBoxTimer", 5000, false);
}
forward InfoBoxTimer(playerid);
public InfoBoxTimer(playerid)
{
if(ShadInfoBoxShowing[playerid] == 1)
{
TextDrawHideForPlayer(playerid, ShadInfoBox);
TextDrawDestroy(ShadInfoBox);
KillTimer(InfoTimer);
printf("(%d) Has Just Deleted the Shadow Info Box From his Screen",playerid);
return 1;
}
return 1;
}
Re: Box not hide automatically -
xRadical3 - 08.04.2019
Use
https://sampwiki.blast.hk/wiki/SetTimerEx
pawn Code:
InfoTimer = SetTimerEx("InfoBoxTimer", 5000, false, "i", playerid);
Re: Box not hide automatically -
MichiCZ - 08.04.2019
It works, thanks