Worldtime einstellen?

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Guten Abend Liebe Community.
    Ich wollte mal nach fragen ob jemand mir helfen könnte und erklären kann,
    wie man die World Time uhr einstellt?
    Die geht 1 Stunde zurück also derzeit ist es 11 uhr auf dem Server.


    mfg SkyAngel

  • Ja ohne Pawn Code kann ichs nicht riechen...


    Aber ich denke dir fehlt FixHour^^


    Header:
    forward FixHour(hour);
    new shifthour;


    /Time Befehl mit Fixxed Hour:
    if(strcmp(cmd, "/time", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new mtext[20];
    new year, month,day;
    getdate(year, month, day);
    if(month == 1) { mtext = "Januar"; }
    else if(month == 2) { mtext = "Februar"; }
    else if(month == 3) { mtext = "März"; }
    else if(month == 4) { mtext = "April"; }
    else if(month == 5) { mtext = "Mai"; }
    else if(month == 6) { mtext = "Juni"; }
    else if(month == 7) { mtext = "Juli"; }
    else if(month == 8) { mtext = "August"; }
    else if(month == 9) { mtext = "September"; }
    else if(month == 10) { mtext = "Oktober"; }
    else if(month == 11) { mtext = "November"; }
    else if(month == 12) { mtext = "Dezember"; }
    new hour,minuite,second;
    gettime(hour,minuite,second);
    FixHour(hour);
    hour = shifthour;
    if (minuite < 10)
    {
    if (PlayerInfo[playerid][pJailTime] > 0)
    {
    format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Knastzeit: %d sek", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
    }
    else
    {
    format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
    }
    }
    else
    {
    if (PlayerInfo[playerid][pJailTime] > 0)
    {
    format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Knastzeit: %d sek", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
    }
    else
    {
    format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
    }
    }
    GameTextForPlayer(playerid, string, 5000, 1);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s schaut auf die Uhr.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ApplyAnimation(playerid,"COP_AMBIENT","Coplook_watch",4.1,0,0,0,0,0);
    }
    return 1;
    }


    Hier der Public
    public FixHour(hour)
    {
    hour = timeshift+hour;
    if (hour < 0)
    {
    hour = hour+24;
    }
    else if (hour > 23)
    {
    hour = hour-24;
    }
    shifthour = hour;
    return 1;
    }



    Lua: 63% C++: 23% C#: 53% VB: 96%

  • if(strcmp(cmd, "/time", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new mtext[20];
    new year, month,day;
    getdate(year, month, day);
    if(month == 1) { mtext = "Januar"; }
    else if(month == 2) { mtext = "Februar"; }
    else if(month == 3) { mtext = "März"; }
    else if(month == 4) { mtext = "April"; }
    else if(month == 5) { mtext = "Mai"; }
    else if(month == 6) { mtext = "Juni"; }
    else if(month == 7) { mtext = "Juli"; }
    else if(month == 8) { mtext = "August"; }
    else if(month == 9) { mtext = "September"; }
    else if(month == 10) { mtext = "Oktober"; }
    else if(month == 11) { mtext = "November"; }
    else if(month == 12) { mtext = "Dezember"; }
    new hour,minuite,second;
    gettime(hour,minuite,second);
    FixHour(hour);
    hour = shifthour;
    if (minuite < 10)
    {
    if (PlayerInfo[playerid][pJailTime] > 0)
    {
    format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Knastzeit: %d sek", day, mtext, hour+1, minuite, PlayerInfo[playerid][pJailTime]-10);
    }
    else
    {
    format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour+1, minuite);
    }
    }
    else
    {
    if (PlayerInfo[playerid][pJailTime] > 0)
    {
    format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Knastzeit: %d sek", day, mtext, hour+1, minuite, PlayerInfo[playerid][pJailTime]-10);
    }
    else
    {
    format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour+1, minuite);
    }
    }
    GameTextForPlayer(playerid, string, 5000, 1);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s schaut auf die Uhr.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ApplyAnimation(playerid,"COP_AMBIENT","Coplook_watch",4.1,0,0,0,0,0);
    }
    return 1;
    }