clock
#4

Your code hurts my eyes

pawn Код:
#include <a_samp>

forward RealHourUpdate();
new T_DAY = 0, WorldTime, Text:DAN, Text:Clock;

public OnPlayerSpawn(playerid)
{
    TextDrawShowForAll(DAN);
    TextDrawShowForAll(Clock);
    return 1;
}

public OnGameModeInit()
{
    SetTimer("SetRandomWeather", 420000, true);
    SetTimer("RealHourUpdate", 1000, true);

    DAN = TextDrawCreate(497.000000, 5.000000, "/");
    TextDrawFont(DAN, 3);
    TextDrawLetterSize(DAN, 0.6, 1.5);
    TextDrawSetOutline(DAN, 2);
    TextDrawSetProportional(DAN, 1);
    TextDrawSetShadow(DAN, 1);

    Clock = TextDrawCreate(546.9, 21.0, "/");
    TextDrawSetShadow(Clock, 1);
    TextDrawSetOutline(Clock, 2);
    TextDrawLetterSize(Clock, 0.6, 2.4);
    TextDrawFont(Clock, 3);
    TextDrawSetProportional(Clock, 1);

    return 1;
}

public RealHourUpdate()
{
    new h, m, sc;
    gettime(h, m, sc);
    if(WorldTime != h)
    {
        WorldTime = h;
        SetWorldTime(WorldTime);
    }
   
    if(0 == h && 0 == m && 0 == sc) ++T_DAY;
   
    new string[16];
    switch(T_DAY) {
        case 0: strcat(string, "Monday");
        case 1: strcat(string, "Tuesday");
        case 2: strcat(string, "Wednesday");
        case 3: strcat(string, "Thursday");
        case 4: strcat(string, "Friday");
        case 5: strcat(string, "Saturday");
        case 6: strcat(string, "Sunday");
    }
    TextDrawSetString(DAN, string);
   
    new result[33];
    format(result, sizeof(result), "worldtime %s %02d:%02d",string, h, m);
    SendRconCommand(result);
   
    format(string,sizeof(string),"%02d:%02d",h,m);
    TextDrawSetString(Clock, string);
}
@e: removed unnecessary boolean
Reply


Messages In This Thread
clock - by sscarface - 07.02.2013, 17:37
Re: clock - by Scenario - 07.02.2013, 17:41
Re: clock - by sscarface - 07.02.2013, 19:39
Re: clock - by Misiur - 07.02.2013, 20:07
Re: clock - by sscarface - 07.02.2013, 20:17
Re: clock - by Misiur - 07.02.2013, 20:28
Re: clock - by sscarface - 07.02.2013, 20:34
Re: clock - by Misiur - 07.02.2013, 21:05
Re: clock - by sscarface - 07.02.2013, 21:19

Forum Jump:


Users browsing this thread: 7 Guest(s)