Server /time?
#5

I don't know how to show it for a certain time, but I know how to create the clock on your screen (high on the right)
pawn Код:
new Clock[MAX_PLAYERS];

forward UpdateClock(playerid);
public UpdateClock(playerid)
{
    gettime(Shour, Sminute, Ssecond);
    new string[56];
    if(Sminute < 10) {
        if(Shour <10) {
            if(Ssecond <10) {
                format(string,sizeof(string),"%s~n~0%d:0%d:0%d",string2,Shour,Sminute, Ssecond);
            } else {
                format(string,sizeof(string),"%s~n~0%d:0%d:%d",string2,Shour,Sminute, Ssecond);
            }
        } else {
            if(Ssecond <10) {
                format(string,sizeof(string),"%s~n~%d:0%d:0%d",string2,Shour,Sminute, Ssecond);
            } else {
                format(string,sizeof(string),"%s~n~%d:0%d:%d",string2,Shour,Sminute, Ssecond);
            }
        }
    } else {
        if(Shour < 10) {
            if(Ssecond <10) {
                format(string,sizeof(string),"%s~n~0%d:%d:0%d",string2,Shour,Sminute,Ssecond);
            } else {
                format(string,sizeof(string),"%s~n~0%d:%d:%d",string2,Shour,Sminute,Ssecond);
            }
        } else {
            if(Ssecond <10) {
                format(string,sizeof(string),"%s~n~%d:%d:0%d",string2,Shour,Sminute, Ssecond);
            } else {
                format(string,sizeof(string),"%s~n~%d:%d:%d",string2,Shour,Sminute, Ssecond);
            }
        }
    }
    Clock[playerid] = TextDrawCreate(543.0, 22.0, string);
    TextDrawSetShadow(Clock[playerid], 0);
    TextDrawSetOutline(Clock[playerid], 2);
    TextDrawLetterSize(Clock[playerid], 0.6, 1.8);
    TextDrawFont(Clock[playerid], 3);
    TextDrawShowForPlayer(playerid, Clock[playerid]);
}
Reply


Messages In This Thread
Server /time? - by DarrenReeder - 20.09.2010, 10:54
Re: Server /time? - by Cameltoe - 20.09.2010, 11:00
Re: Server /time? - by DarrenReeder - 20.09.2010, 11:03
Re: Server /time? - by DarrenReeder - 23.09.2010, 18:20
Re: Server /time? - by CAR - 23.09.2010, 19:48
Re: Server /time? - by DarrenReeder - 23.09.2010, 19:51
Re: Server /time? - by The_Moddler - 23.09.2010, 19:54

Forum Jump:


Users browsing this thread: 1 Guest(s)