TextDraw Issue - 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: TextDraw Issue (
/showthread.php?tid=376286)
TextDraw Issue -
nmader - 09.09.2012
Alright, so I am making a clock system for my Server, I have done everything that I believe has to be done, however it does not work... (No errors, just does nothing.)
Public OnPlayerConnect(playerid)
pawn Код:
TimeText = TextDrawCreate(544.000000, 24.000000, " ");
TextDrawHideForPlayer(playerid,TimeText[playerid]);
TextDrawBackgroundColor(TimeText, 255);
TextDrawFont(TimeText, 2);
TextDrawLetterSize(TimeText, 0.340000, 1.000000);
TextDrawColor(TimeText, -1);
TextDrawSetOutline(TimeText, 0);
TextDrawSetProportional(TimeText, 1);
TextDrawSetShadow(TimeText, 1);
SetTimerEx("TimeInterval", 1000, true, "i", playerid);
TimerInterval(playerid)
pawn Код:
new string[128];
new hour, minute, second;
gettime(hour, minute, second);
format(string,sizeof(string),"%d:%d:%d", hour, minute, second);
TextDrawSetString(TimeText, string);
TextDrawShowForPlayer(playerid, TimeText);
return 1;
I am personally clueless on how to fix it.
Re: TextDraw Issue -
detter - 09.09.2012
TexDraw goes in OnGameModeInit or somewhere like that ,not in OnPlayerConnect
Re: TextDraw Issue -
Jessyy - 09.09.2012
Try this ...
Код:
new TimeText;
public OnGameModeInit()
{
TimeText = TextDrawCreate(544.00, 24.00, "_");
TextDrawFont (TimeText, 2);
TextDrawColor (TimeText, -1);
TextDrawLetterSize (TimeText, 0.34, 1.00);
TextDrawBackgroundColor (TimeText, 255);
TextDrawSetOutline (TimeText, 0);
TextDrawSetProportional (TimeText, 1);
TextDrawSetShadow (TimeText, 1);
SetTimerEx("TimeInterval", 1000, true);
return 1;
}
public TimeInterval()
{
new string[30], hour, minute, second;
gettime(hour, minute, second);
format(string,sizeof(string),"%02d:%02d:%02d", hour, minute, second);
TextDrawSetString(TimeText, string);
TextDrawShowForAll(TimeText);
return 1;
}