Textdraw Uhr Problem

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
  • Habe mal mit nem Textdraw ne Uhr gemacht:
    new Text:Uhr;
    forward UpdateUhr();
    //Unter OnGameModeInit:
    Uhr = TextDrawCreate(545.000000,21.000000,"15:17");
    TextDrawBackgroundColor(Uhr,255);
    TextDrawFont(Uhr,3);
    TextDrawLetterSize(Uhr,0.509999,2.299999);
    TextDrawColor(Uhr,-1);
    TextDrawSetOutline(Uhr,0);
    TextDrawSetProportional(Uhr,1);
    TextDrawSetShadow(Uhr,1);
    ManualVehicleEngineAndLights();
    SetTimer("UpdateUhr",1000,1);
    //Im Public:
    public UpdateUhr()
    {
    new Stunde,Minute,Sekunde,string[256];
    gettime(Stunde,Minute,Sekunde);
    if(Stunde <9 && Minute <9) { format(string,256,"0%d:0%d",Stunde,Minute); }
    else if(Stunde>9 && Minute<9) {format(string,256,"%d:0%d",Stunde,Minute);}
    else if(Stunde<9 && Minute>9) {format(string,256,"0%d:%d",Stunde,Minute);}
    else {format(string,256,"%d:%d",Stunde,Minute);}
    TextDrawSetString(Uhr,string);
    SetWorldTime(Stunde);
    return 1;
    }
    Mein eigentliches Problem: Meine Uhr wird nicht angezeigt Ingame?
    Wo fehlt was oder ist was falsch?
    Es kommen keine Fehlermeldungen..
    Danke im Voraus


    MFG

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • Ehm fast richtig aber unter OnPlayerConnect komm TextDraw Show For All und das selbe bei disconnect halt mit hide for all logisch da du kein showfor all hast kann nich angezeigt werden bei textdraw muss immer show fore player oder show for all stehn naturülich muss es richitg geschrieben werden xD zu not guck samp wiki ShowForPlayer oder ShowForAll

  • Das was ich unter OnGameModeInit gemacht habe muss also alles unter OnPlayerConnect oder was?

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • das bei onplayerconnect rein


    TextdrawShowForPlayer(playerid,TEXTDRAWNAME);

  • Jetzt wird die Uhr zwar angezeigt wird aber nicht jede Minute aktualisiert, sprich die Uhrzeit bleibt stehen... :O

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • ehm mom ich schau gerade noch mal also dir fehlt glaub noch das hier


    public UpdateTime()


    {


    gettime(hour, minute);


    format(timestr,32,"%02d:%02d",hour,minute);


    TextDrawSetString(txtTimeDisp,timestr);




    SetWorldTime(hour);




    new x=0;


    while(x!=MAX_PLAYERS) {


    if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {


    SetPlayerTime(x,hour,minute);


    }


    x++;


    }


    }


    ansonsten würde ich aus dem fs gl_realtime das nötige holen ^^

  • Den Timer hatte ich dcoh schon längst. Ging aber nicht....

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • Guck dir mal das Filterscript von samp an "gl_realtime"


    da mal reingucken um zu sehen wie das gemacht wurde dann findest du den fehler ganz schnell