/makeadmin für rcon Admin

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 Leute
    In meinem Neuen Script funktioniert das mit .ini admin machen nicht und
    deswegen wollte ich frage wie man den Befehl /makeadmin auch für rcon admins machen kann???
    Habe hier mal den /makeadmin befehl:
    if(strcmp(cmd, "/makeadmin", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "[CMDINFO]: /makeadmin [playerid] [Level]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    new level = strval(tmp);
    if(level < 0 || level > 4) { SendClientMessage(playerid, COLOR_RED, "[ERROR:] 0-10 = Valid Levels."); return 1; }
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    format(string, sizeof(string), "%s has made %s a server admin", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
    Adminmsg(string);


    format(string, sizeof(string), "%s has made you a server admin level %d, congratulations. Your commands are /admcmds (or /ah, or /acmds)", GetPlayerNameEx(playerid), level, GetPlayerNameEx(giveplayerid));
    SendClientMessage(giveplayerid, COLOR_RED, string);
    PlayerInfo[giveplayerid][pAdmin] = level;
    return 1;
    }
    }
    }
    }

  • Man fragt mit


    IsPlayerAdmin(playerid)
    ab, ob jemand RCON-Admin ist.
    Also in deinem Fall:


    if(strcmp(cmd, "/makeadmin", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] >= 4 || IsPlayerAdmin(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "[CMDINFO]: /makeadmin [playerid] [Level]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    new level = strval(tmp);
    if(level < 0 || level > 4) { SendClientMessage(playerid, COLOR_RED, "[ERROR:] 0-10 = Valid Levels."); return 1; }
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    format(string, sizeof(string), "%s has made %s a server admin", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
    Adminmsg(string);
    format(string, sizeof(string), "%s has made you a server admin level %d, congratulations. Your commands are /admcmds (or /ah, or /acmds)", GetPlayerNameEx(playerid), level, GetPlayerNameEx(giveplayerid));
    SendClientMessage(giveplayerid, COLOR_RED, string);
    PlayerInfo[giveplayerid][pAdmin] = level;
    return 1;
    }
    }
    }
    }