Zeit System

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
  • wen ich mich nicht teusche


    new realtime = 1;


    Der rest unter public OnGameModeInit()


    if(!realtime)
    {
    SetWorldTime(wtime);
    }




    if (realtime)
    {
    new tmphour;
    new tmpminute;
    new tmpsecond;
    gettime(tmphour, tmpminute, tmpsecond);
    FixHour(tmphour);
    tmphour = shifthour;
    SetWorldTime(tmphour);
    }


    if (realtime)
    {
    SetWorldTime(tmphour);
    }
    }
    }

  • Ja das ist das hier


    #include <a_samp>
    #define FILTERSCRIPT


    new Text:RealClock,Timer;


    public OnFilterScriptInit()
    {
    RealClock = TextDrawCreate(547.000000,22.000000," ");
    TextDrawAlignment(RealClock,0);
    TextDrawBackgroundColor(RealClock,0x000000ff);
    TextDrawFont(RealClock,3);
    TextDrawLetterSize(RealClock,0.599999,2.299999);
    TextDrawColor(RealClock,0xffffffff);
    TextDrawSetOutline(RealClock,1);
    TextDrawSetProportional(RealClock,1);
    TextDrawSetShadow(RealClock,10);
    Timer = SetTimer("UpdateClock",300,1);
    return 1;
    }


    public OnFilterScriptExit()
    {
    KillTimer(Timer);
    TextDrawHideForAll(RealClock);
    TextDrawDestroy(RealClock);
    return 1;
    }


    forward UpdateClock();
    public UpdateClock()
    {
    new Hour,Minute,Sec,String[256];
    gettime(Hour,Minute,Sec);
    if(Hour<9 && Minute<9){format(String,sizeof(String),"0%d:0%d",Hour,Minute);}
    else if(Hour>9 && Minute<9){format(String,sizeof(String),"%d:0%d",Hour,Minute);}
    else if(Hour<9 && Minute>9){format(String,sizeof(String),"0%d:%d",Hour,Minute);}
    else{format(String,sizeof(String),"%d:%d",Hour,Minute);}
    TextDrawSetString(RealClock,String);
    SetWorldTime(Hour);
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    TextDrawShowForPlayer(playerid,RealClock);
    return 1;
    }


    public OnPlayerDisconnect(playerid,reason)
    {
    TextDrawHideForPlayer(playerid,RealClock);
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    TextDrawHideForPlayer(playerid,RealClock);
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    TextDrawHideForPlayer(playerid,RealClock);
    return 1;
    }

    das is ne uhr^^


  • This ....

  • thx habs aber schon gemacht von a day er hat nur mir die pwn datei geschickt mit der uhr oben die hab ich entfernt wer es als fs haben will hier #include <a_samp>
    #define FILTERSCRIPT


    new Text:RealClock,Timer;


    public OnFilterScriptInit()
    {
    RealClock = TextDrawCreate(547.000000,22.000000," ");
    Timer = SetTimer("UpdateClock",300,1);
    return 1;
    }


    public OnFilterScriptExit()
    {
    KillTimer(Timer);
    TextDrawHideForAll(RealClock);
    TextDrawDestroy(RealClock);
    return 1;
    }


    forward UpdateClock();
    public UpdateClock()
    {
    new Hour,Minute,Sec,String[256];
    gettime(Hour,Minute,Sec);
    if(Hour<9 && Minute<9){format(String,sizeof(String),"0%d:0%d",Hour,Minute);}
    else if(Hour>9 && Minute<9){format(String,sizeof(String),"%d:0%d",Hour,Minute);}
    else if(Hour<9 && Minute>9){format(String,sizeof(String),"0%d:%d",Hour,Minute);}
    else{format(String,sizeof(String),"%d:%d",Hour,Minute);}
    TextDrawSetString(RealClock,String);
    SetWorldTime(Hour);
    return 1;
    }



    //edit ich hab jetzt ein admin cmd gemacht mit settime und geht eig auch wen ich ingame jetzt mache /settime uhrzeit dan ist 1 sek hell ^^ und dan wieder rl uhrzeit wie kann ich das ändern^^


    mfg Leito

    Einmal editiert, zuletzt von John_Conner ()