[HELP] CountDown TextDraw Bugs - 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: [HELP] CountDown TextDraw Bugs (
/showthread.php?tid=637661)
[HELP] CountDown TextDraw Bugs -
ThomasEvil - 19.07.2017
NEVER FORGET USE PlayerTextDeawDestroy ON OnPlayerDisconnect !
Solved.
Re: [HELP] CountDown TextDraw Bugs -
Kane - 19.07.2017
For your second problem, you need to make a PLAYER TEXTDRAW for basis like this.
https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw (Check Related Functions.)
For your first problem,
You don't need to hide and recreate the textdraw. Simply set the string as:
PHP код:
public UpdateMuteTime(playerid)
{
if(PlayerInfo[playerid][pMutedTime] < 1)
{
KillTimer(MuteTime[playerid]);
PlayerInfo[playerid][pMuted] = 0;
PlayerInfo[playerid][pMutedTime] = 0;
PlayerTextDrawHide(playerid,MuteTimeTextDraw[playerid]);
return 1;
}
new timeString[32];
format(timeString, sizeof(timeString), "Mute:%02d:%02d", PlayerInfo[playerid[pMutedTime]/60, PlayerInfo[playerid[pMutedTime]%60);
PlayerTextDrawSetString(playerid, MuteTimeTextDraw[playerid], timeString);
return 1;
}
Re: [HELP] CountDown TextDraw Bugs -
ThomasEvil - 19.07.2017
I DIDNT DESTROY PLAYER'S TEXTDRAW WHEN PLAYER DISCONNECTED.