Server.exe schließt sich bei GMX

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
  • Hallo liebe User,

    ich habe einen GMX Command gmacht und bei dem schließt sich die Console immer.


    Command:
    if (strcmp(cmdtext,"/gmx",true)==0)
    {
    if(!isAdmin(playerid,5))return SendClientMessage(playerid,Rot,"Du hast nicht das nötige Adminlevel dafür!");
    SendClientMessageToAll(Rot,"SERVERNACHRICHT: Der Server wird in 30 Sekunden neugestartet!");
    savePlayer(playerid);
    SetTimer("GMX30",1000,0);
    }
    public GMX30()
    {
    GameTextForAll("GMX: 30",1000,4);
    SetTimer("GMX29",1000,0);
    return 1;
    }
    public GMX29()
    {
    GameTextForAll("GMX: 29",1000,4);
    SetTimer("GMX28",1000,0);
    return 1;
    }
    public GMX28()
    {
    GameTextForAll("GMX: 28",1000,4);
    SetTimer("GMX27",1000,0);
    return 1;
    }
    public GMX27()
    {
    GameTextForAll("GMX: 27",1000,4);
    SetTimer("GMX26",1000,0);
    return 1;
    }
    public GMX26()
    {
    GameTextForAll("GMX: 26",1000,4);
    SetTimer("GMX25",1000,0);
    return 1;
    }
    public GMX25()
    {
    GameTextForAll("GMX: 25",1000,4);
    SetTimer("GMX24",1000,0);
    return 1;
    }
    public GMX24()
    {
    GameTextForAll("GMX: 24",1000,4);
    SetTimer("GMX23",1000,0);
    return 1;
    }
    public GMX23()
    {
    GameTextForAll("GMX: 23",1000,4);
    SetTimer("GMX22",1000,0);
    return 1;
    }
    public GMX22()
    {
    GameTextForAll("GMX: 22",1000,4);
    SetTimer("GMX21",1000,0);
    return 1;
    }
    public GMX21()
    {
    GameTextForAll("GMX: 21",1000,4);
    SetTimer("GMX20",1000,0);
    return 1;
    }
    public GMX20()
    {
    GameTextForAll("GMX: 20",1000,4);
    SetTimer("GMX19",1000,0);
    return 1;
    }
    public GMX19()
    {
    GameTextForAll("GMX: 19",1000,4);
    SetTimer("GMX18",1000,0);
    return 1;
    }
    public GMX18()
    {
    GameTextForAll("GMX: 18",1000,4);
    SetTimer("GMX17",1000,0);
    return 1;
    }
    public GMX17()
    {
    GameTextForAll("GMX: 17",1000,4);
    SetTimer("GMX16",1000,0);
    return 1;
    }
    public GMX16()
    {
    GameTextForAll("GMX: 16",1000,4);
    SetTimer("GMX15",1000,0);
    for(new i; i<MAX_PLAYERS; i++)
    {
    InterpolateCameraPos(i,1372.8593,-931.0602,66.3161, 1176.8585,-960.1643,58.2323, 45000, CAMERA_MOVE);
    InterpolateCameraLookAt(i,1278.8064,-926.8247,49.4459, 1197.3507,-919.9426,46.6816, 45000,CAMERA_MOVE);
    return 1;
    }
    return 1;
    }
    public GMX15()
    {
    GameTextForAll("GMX: 15",1000,4);
    SetTimer("GMX14",1000,0);
    return 1;
    }
    public GMX14()
    {
    GameTextForAll("GMX: 14",1000,4);
    SetTimer("GMX13",1000,0);
    return 1;
    }
    public GMX13()
    {
    GameTextForAll("GMX: 13",1000,4);
    SetTimer("GMX12",1000,0);
    return 1;
    }
    public GMX12()
    {
    GameTextForAll("GMX: 12",1000,4);
    SetTimer("GMX11",1000,0);
    return 1;
    }
    public GMX11()
    {
    GameTextForAll("GMX: 11",1000,4);
    SetTimer("GMX10",1000,0);
    return 1;
    }
    public GMX10()
    {
    GameTextForAll("GMX: 10",1000,4);
    SetTimer("GMX9",1000,0);
    return 1;
    }
    public GMX9()
    {
    GameTextForAll("GMX: 9",1000,4);
    SetTimer("GMX8",1000,0);
    return 1;
    }
    public GMX8()
    {
    GameTextForAll("GMX: 8",1000,4);
    SetTimer("GMX7",1000,0);
    return 1;
    }
    public GMX7()
    {
    GameTextForAll("GMX: 7",1000,4);
    SetTimer("GMX6",1000,0);
    return 1;
    }
    public GMX6()
    {
    GameTextForAll("GMX: 6",1000,4);
    SetTimer("GMX5",1000,0);
    return 1;
    }
    public GMX5()
    {
    GameTextForAll("GMX: 5",1000,4);
    SetTimer("GMX4",1000,0);
    return 1;
    }
    public GMX4()
    {
    GameTextForAll("GMX: 4",1000,4);
    SetTimer("GMX3",1000,0);
    return 1;
    }
    public GMX3()
    {
    GameTextForAll("GMX: 3",1000,4);
    SetTimer("GMX2",1000,0);
    return 1;
    }
    public GMX2()
    {
    GameTextForAll("GMX: 2",1000,4);
    SetTimer("GMX1",1000,0);
    return 1;
    }
    public GMX1()
    {
    GameTextForAll("GMX: 1",1000,4);
    SetTimer("GMXKICK",1000,0);
    return 1;
    }
    public GMXKICK()
    {
    SendRconCommand("gmx");
    return 1;
    }

  • Ja, bin noch Anfänger, ist das schlümm?


    mach eine variable die mit 30 anfängt und dann nen Timer der die Variable immer decrementiert, sobald die variable 0 erreicht hat machst du den Killtimer + GMX befehl.



    Spoiler anzeigen

    new RsTimer;
    new Count = 30;
    public OnPlayerCommandText(playerid, cmdtext[]){
    if (!strcmp("/gmx",cmdtext,true)){
    SendClientMessageToAll(-1,"SERVERNACHRICHT: [SERVER] Der Server wird sich in 30 Sekunden neustarten.");
    RsTimer = SetTimer("Restart",1000,true);
    return 1;
    }
    return 0;
    }
    forward Restart();
    public Restart(){
    new text[32];
    format(text,sizeof(text),"Neustart in: %d",Count);
    GameTextForAll(text,1000,4);
    Count--;
    if(Count <= 0){
    KillTimer(RsTimer);
    SendRconCommand("gmx");
    }
    return 1;
    }

  • savePlayer(playerid)
    {
    if(sInfo[playerid][eingeloggt]==0)return 1;
    //Speichern (Level,Geld)
    new query[128];
    format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',adminlevel='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][adminlevel],sInfo[playerid][pid]);
    mysql_function_query(dbhandle,query,false,"","");
    return 1;
    }

  • Oha, habe gerade was endeckt:


    [13:31:47] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [13:31:47] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [13:32:18] [ERROR] CMySQLQuery::Execute[OnUserCheck(i)] - (error #2006) MySQL server has gone away
    [13:32:18] [WARNING] CMySQLQuery::Execute[OnUserCheck(i)] - lost connection, reconnecting..
    [13:32:18] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [13:33:07] [ERROR] CMySQLQuery::Execute[OnUserCheck(i)] - (error #2006) MySQL server has gone away
    [13:33:07] [WARNING] CMySQLQuery::Execute[OnUserCheck(i)] - lost connection, reconnecting..
    [13:33:07] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [13:34:54] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [13:34:54] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [13:35:58] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [13:35:58] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [13:36:29] [ERROR] CMySQLQuery::Execute[OnUserCheck(i)] - (error #2006) MySQL server has gone away
    [13:36:29] [WARNING] CMySQLQuery::Execute[OnUserCheck(i)] - lost connection, reconnecting..
    [13:36:29] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'root' localhost (using password: YES)
    [20:51:17] [ERROR] CMySQLQuery::Execute[()] - (error #2013) Lost connection to MySQL server during query
    [20:51:29] [ERROR] CMySQLConnection::Connect - (error #2008) MySQL client ran out of memory
    [20:51:29] [ERROR] CMySQLConnection::Connect - MySQL initialization failed
    [21:59:24] [ERROR] CMySQLQuery::Execute[()] - (error #2013) Lost connection to MySQL server during query



    EDIT: Habe gerade nochmal neustart gemacht, die Console ging wieder zu aber diesmal hat er nichts in die log eingetragen, also sind die Meldungen nicht wegen meinem Problem