[MYSQL]Setadmin befehl?

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
  • Hey leute ich wollte mal fragen, wie man mit mysql einen SetAdmin befehl macht.
    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    mysql_SetInt("accounts", "Level", SpielerInfo[playerid][pLevel], "Name", SpielerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Geld", SpielerInfo[playerid][pGeld], "Name", SpielerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Kills", SpielerInfo[playerid][pKills], "Name", SpielerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Tode", SpielerInfo[playerid][pTode], "Name", SpielerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Admin", SpielerInfo[playerid][pAdmin], "Name", SpielerInfo[playerid][pName]);
    mysql_SetFloat("accounts", "Health", SpielerInfo[playerid][pHealth], "Name", SpielerInfo[playerid][pName]);
    }
    }
    return 1;
    }
    Wie muss ich also vorgehen wenn ich /setadmin SPIELERNAME/ID ADMINLEVEL machen möche. ?
    Danke :)

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox


  • ocmd:setadmin(playerid,params[])
    {
    if(!isAdmin(playerid,/*hier einsetzten ab welchen rang man das kann*/))return SendClientMessage(playerid,ROT,"Du bist dazu nicht befugt!");
    new pID,a_level;
    if(sscanf(params,"ui",pID,a_level))return SendClientMessage(playerid,ROT,"INFO: /makeadmin [ID] [level]");
    sInfo[pID][pAdminl]= Admin;
    savePlayer(pID);
    SendClientMessage(pID,ROT,"Dein Adminrang wurde geändert.");
    SendClientMessage(playerid,ROT,"Dein hast den Adminrang geändert.");
    return 1;
    }

  • Jeffry:
    Danke funktioniert.
    Andres Problem nachdem ich beim Registrieren den Spieler spawnen lasse kommt da: "Spiel Läd" und "Stay within the world boundries" und das ganze flackert so rum.
    Kannst du mir da helfen?

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • /E:
    @[NGD]Manne:
    Habe jetz AddPlayerClass unter ongamemodeinit ist immernoch so.

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • @[NGD]Manne:
    switch(dialogid)
    {
    case DIALOG_REGISTER:
    {
    if(response)
    {
    if(strlen(inputtext) == 0)
    {
    ShowPlayerDialog(playerid, DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrierung", "Willkommen auf {00B9FF}XYZ-Roleplay.\n Bitte gebe dein gewünschtes Passwort an.", "Register", "Exit");
    return 1;
    }
    else
    {
    CreateAccount(playerid, inputtext);
    SetPVarInt(playerid,"Eingeloggt",1);
    SpawnPlayer(playerid);
    }
    }
    else
    {
    SCM(playerid,ROT,"Du musst ein Passwort angeben!");
    Kick(playerid);
    }
    }
    case DIALOG_LOGIN:
    {
    if(response)
    {
    if(strlen(inputtext) == 0)
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Login","Willkommen auf {00B9FF}XYZ-Roleplay.\n Bitte gib dein Passwort an.","Login","Abbrechen");
    return 1;
    }
    else
    {
    new SpielerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, SpielerName, MAX_PLAYER_NAME);
    if(!strcmp(inputtext, mysql_ReturnPasswort(SpielerName), true))
    {
    SetPVarInt(playerid, "Eingeloggt", 1);
    LoadPlayer(playerid);
    SpawnPlayer(playerid);
    return 1;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Login","Willkommen auf {00B9FF}XYZ-Roleplay.\n Bitte gib dein Passwort an.","Login","Abbrechen");
    }
    }
    }
    else
    {
    SCM(playerid,ROT,"Du musst ein Passwort angeben!");
    Kick(playerid);
    }
    }
    }

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • Jeffry:
    @[NGD]Manne:
    OnGamemodeInit:
    AntiDeAMX();
    Connect_To_Database();
    SetGameModeText("ZENSIERT");
    DisableInteriorEnterExits();
    ManualVehicleEngineAndLights();
    AllowInteriorWeapons(1);
    ShowPlayerMarkers(0);
    SetNameTagDrawDistance(70.0);
    AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);


    OnPlayerRequestClass:
    if(GetPVarInt(playerid,"Eingeloggt") == 0)
    {
    if(mysql_checkaccount(playerid) == 0)
    {
    SCM(playerid, HELLBLAU, "Willkommen auf XYZ-ROLEPLAY");
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrierung","Willkommen auf {00B9FF}XYZ-Roleplay.\n Bitte gebe dein gewünschtes Passwort an.","Register","Exit");
    }
    else if(mysql_checkaccount(playerid) == 1)
    {
    SCM(playerid, HELLBLAU, "Willkommen auf XYZ-ROLEPLAY");
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Login","Willkommen auf {00B9FF}XYZ-Roleplay.\n Bitte gib dein Passwort an.","Login","Abbrechen");
    }

    }


    OnPlayerSpawn:
    public OnPlayerSpawn(playerid)
    {
    GivePlayerMoney(playerid, 1000000);
    SetPlayerPos(playerid, 0.0, 0.0, 3.0);
    return 1;
    }

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • @[NGD]Manne:
    new SpielerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, SpielerName, MAX_PLAYER_NAME);
    if(!strcmp(inputtext, mysql_ReturnPasswort(SpielerName), true))
    {
    SetPVarInt(playerid, "Eingeloggt", 1);
    SetSpawnInfo(playerid,0,0,0.0, 0.0, 3.0,0,0,0,0,0,0,0);
    LoadPlayer(playerid);
    SpawnPlayer(playerid);
    return 1;
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Login","Willkommen auf {00B9FF}XYZ-Roleplay.\n Bitte gib dein Passwort an.","Login","Abbrechen");
    }

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • @CIBERKILLER:
    Ich hab das einfach ausm Internet rausgenommen.
    ja das soll die mitte sein

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox