TextDrawSetString problem - 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: TextDrawSetString problem (
/showthread.php?tid=497603)
TextDrawSetString problem -
Dj_maryo1993 - 27.02.2014
I made a clock , but it doesnt change ,it stays at the hour you enter .
Код:
stock UpdateTime()
{
gettime(clockhour, clockminute);
format(timestr,32,"%02d:%02d",clockhour,clockminute);
TextDrawSetString(txtTimeDisp,timestr);
}
Код:
public OnGameModeInit()
{
//some code
SetTimer("UpdateTime",1000 * 60,1);
return 1;
}
Код:
txtTimeDisp = TextDrawCreate(605.0,25.0,"00:00");
TextDrawUseBox(txtTimeDisp, 0);
TextDrawFont(txtTimeDisp, 3);
TextDrawSetShadow(txtTimeDisp,0); // no shadow
TextDrawSetOutline(txtTimeDisp,2); // thickness 1
TextDrawBackgroundColor(txtTimeDisp,0x000000FF);
TextDrawColor(txtTimeDisp,0xFFFFFFFF);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.5,1.5);
UpdateTime();
LE :Edit , forgot that functions can be called via timer only if public