Textdraw won't hide - 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: Textdraw won't hide (
/showthread.php?tid=267859)
Textdraw won't hide -
Outcast - 10.07.2011
Well, I made a test command for my paycheck system, but my textdraw won't hide. When I create it on OnPlayerConnect, I managed to hide it. But, when I show it again when a player gets his paycheck, it shows up but won't hide again.
pawn Код:
public GivePlayerPaycheck(playerid, ammount)
{
new string[80]
pInfo[playerid][pPaycheck] += ammount;
format(string ,sizeof(string), "[Paycheck] + $ %i [Total: $ %i", ammount, pInfo[playerid][pPaycheck]);
TextDrawShowForPlayer(playerid, PaycheckTD[playerid]);
TextDrawSetString(PaycheckTD[playerid], string);
SetTimerEx("HidePaycheckTD", 5000, false, "i", playerid);
return 1;
}
public HidePaycheckTD(playerid)
{
TextDrawHideForPlayer(playerid, PaycheckTD[playerid]);
return 1;
}
Re: Textdraw won't hide -
PotH3Ad - 10.07.2011
Don't think you need to reshow it using TextDrawSetString, but this should fix it (Sleepy, 1:07 Am -_-):
pawn Код:
public GivePlayerPaycheck(playerid, ammount)
{
new string[80]
pInfo[playerid][pPaycheck] += ammount;
format(string ,sizeof(string), "[Paycheck] + $ %i [Total: $ %i", ammount, pInfo[playerid][pPaycheck]);
TextDrawHideForPlayer(playerid, PaycheckTD[playerid]);
TextDrawSetString(PaycheckTD[playerid], string);
TextDrawShowForPlayer(playerid, PaycheckTD[playerid]);
SetTimerEx("HidePaycheckTD", 5000, false, "i", playerid);
return 1;
}
Re: Textdraw won't hide -
Outcast - 10.07.2011
I managed to get it working. I forgot to kill the timer lol.