[Tutorial] Time System - 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: Tutorials (
https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Time System (
/showthread.php?tid=282260)
Re: Time System -
AceFlyer - 11.09.2011
i made it like this because well its easier to make a day in samp with minutes because you can actually see the time changing from day to night and to me it looks better than taking a few hours to change from night to day that way people will enjoy the time changing anyway its easy to make add hours to this tut try it just add one more variable and make the timer reset the mins to 00 every 60 mins and then add 1 to the hours sorry if i am not being very clear if you need help with it pm me
Re: Time System -
Millionaire - 11.09.2011
Nice tut
Re: Time System -
GAMER_PS2 - 30.10.2011
Nice Tutorial AceFlyer Next time use this one
pawn Code:
public TimeU()
{
new string[7];
Tsec+=1;
if(Tsec==60) {
Tsec=00;
THrs+=1;
}
if(THrs==24) {
Tsec=00;
THrs=0;
}
if(Tsec<10) {
format(string,sizeof(string),"%d:%d0",THrs,Tsec);
}
if(Tsec>10) {
format(string,sizeof(string),"%d:%02d",THrs,Tsec);
}
if(THrs<10) {
format(string,sizeof(string),"0%d:%02d",THrs,Tsec);
}
for(new i; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
SetPlayerTime(i,THrs,Tsec);
}
}
TextDrawSetString(Time,string);
return 1;
}
so theres 0 before the numer 1 to 9 like this
"06:01" anyway i love it! i using it on my gangwar gamemode
Re: Time System -
Tanush123 - 21.01.2012
Quote:
Originally Posted by GAMER_PS2
Nice Tutorial AceFlyer Next time use this one
pawn Code:
public TimeU() { new string[7]; Tsec+=1; if(Tsec==60) { Tsec=00; THrs+=1; } if(THrs==24) { Tsec=00; THrs=0; } if(Tsec<10) { format(string,sizeof(string),"%d:%d0",THrs,Tsec); } if(Tsec>10) { format(string,sizeof(string),"%d:%02d",THrs,Tsec); } if(THrs<10) { format(string,sizeof(string),"0%d:%02d",THrs,Tsec); } for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SetPlayerTime(i,THrs,Tsec); } } TextDrawSetString(Time,string); return 1; }
so theres 0 before the numer 1 to 9 like this
"06:01" anyway i love it! i using it on my gangwar gamemode
|
If people plans to copy and paste (like me xD because this is amazing), people will get a error with
pawn Code:
TextDrawSetString(Time,string);
Change it to
pawn Code:
TextDrawSetString(Servt,string);
and also nice FS