Game Time Help
#1

Ok so I want to be able to set my game time so lets say it's 18h:10m:20s, I would want to be able to set it to lets say 19h:20m:0s, How would I do this? I use zcmd and i want it to be set to /tod for the command.


My clock timer
pawn Код:
forward Clock();
public Clock()
{
    new string[128];
    gettime(thour, tmin, tsec);
    new Day, Month, Year;
    getdate(Year, Month, Day);
    //clock fixes-Fox
    new clockfix[4];
    if(tsec < 10) format(clockfix, sizeof(clockfix), "0%d", tsec);
    else if(tsec >= 10) format(clockfix, sizeof(clockfix), "%d", tsec);
    new minfix[4];
    if(tmin < 10) format(minfix, sizeof(minfix), "0%d", tmin);
    else if(tmin >= 10) format(minfix, sizeof(minfix), "%d", tmin);
    new hourfix[4];
    if(thour < 10) format(hourfix, sizeof(hourfix), "0%d", thour);
    else if(thour >= 10) format(hourfix, sizeof(hourfix), "%d", thour);
    format(string, sizeof(string), "~r~~r~Game Time: ~w~%s:%s:%s", hourfix, minfix, clockfix);
    TextDrawSetString(TimeTD, string);
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i))
        {
            if(!IsAFK[i])
            {
                PlayerInfo[i][pDay] = Day;
                Seconds[i] ++;
                if(Seconds[i] == 60)
                {
                    Seconds[i] = 0;
                    PlayerInfo[i][pMinutes] ++;
                    PlayerInfo[i][pTMinutes] ++;
                    if(PlayerInfo[i][pVIPTemp])
                    {
                        PlayerInfo[i][pVIPTemp] --;
                        if(PlayerInfo[i][pVIPTemp] <= 0)
                        {
                            PlayerInfo[i][pVIP] = 0;
                            PlayerInfo[i][pVIPDay] = 0;
                            PlayerInfo[i][pVIPMonth] = 0;
                            PlayerInfo[i][pVIPHour] = 0;
                            PlayerInfo[i][pVIPTemp] = 0;
                            format(string, sizeof(string), "AdmWarn: %s's temporary Bronze VIP package has expired.", RPN(i));
                            SendAdminMessage(COLOR_DARKRED, 1, string);
                            Log("logs/makevip.log", string);
                            SendClientMessage(i, COLOR_LIGHTBLUE, " Your temporary Bronze VIP package has expired.");
                        }
                    }
                }
                if(PlayerInfo[i][pVIP])
                {
                    if(Day >= PlayerInfo[i][pVIPDay] && Month >= PlayerInfo[i][pVIPMonth] && !PlayerInfo[i][pVIPTemp])
                    {
                        format(string, sizeof(string), "AdmWarn: %s's %s VIP package has expired.", RPN(i), RPVIPN(i));
                        SendAdminMessage(COLOR_DARKRED, 1, string);
                        Log("logs/makevip.log", string);
                        format(string, sizeof(string), " Your %s VIP package has expired.", RPVIPN(i));
                        SendClientMessage(i, COLOR_LIGHTBLUE, string);
                        PlayerInfo[i][pVIP] = 0;
                        PlayerInfo[i][pVIPDay] = 0;
                        PlayerInfo[i][pVIPMonth] = 0;
                        PlayerInfo[i][pVIPHour] = 0;
                        PlayerInfo[i][pVIPTemp] = 0;
                    }
                }
            }
        }
    }
    // Paycheck
    if(tmin == 0 && tsec <= 4 && PayChecks == 0)
    {
        SetWorldTime(thour);
        Paycheck();
        /* Points
        for(new idx = 0; idx<MAX_POINTS; idx++)
        {
            PointBC[idx] = 0;
        }
        for(new idx = 0; idx < MAX_POINTS; idx++)
        {
            if(PointInfo[idx][pTime]) PointInfo[idx][pTime] --;
            if(!PointInfo[idx][pTime] && !PointBC[idx])
            {
                PointInfo[idx][pOwner] = 0;
                PointInfo[idx][pProfit] = 0;
                format(string, sizeof(string), "The {00FF00}%s {FF6347}is available to be captured.", PointInfo[idx][pName]);
                SendClientMessageToAll(COLOR_LIGHTRED, string);
                DestroyDynamicPickup(PointInfo[idx][pPickup]);
                DestroyDynamic3DTextLabel(PointInfo[idx][pText]);
                PointInfo[idx][pText] = CreateDynamic3DTextLabel("Point\n/capture", COLOR_WHITE, PointInfo[idx][pX], PointInfo[idx][pY], PointInfo[idx][pZ]+0.3, 15);

            }
        } */

    }
    return 1;
}
Reply


Messages In This Thread
Game Time Help - by JacobSanchez - 15.02.2014, 12:31
Re: Game Time Help - by JacobSanchez - 15.02.2014, 16:11
Re: Game Time Help - by JacobSanchez - 15.02.2014, 17:28
Re: Game Time Help - by CuervO - 15.02.2014, 17:37
Re: Game Time Help - by JacobSanchez - 15.02.2014, 17:45
Re: Game Time Help - by CuervO - 15.02.2014, 17:57

Forum Jump:


Users browsing this thread: 2 Guest(s)