Problem mit Kick ban usw.

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
  • Also ich habe ein gf script normaler weise geht es dass man /kick nutzen kann wenn man admin level 1 ist doch seit einiger zeit funktioniert es nicht mehr und man muss sich zuerst im rcon einloggen dabei habe ich an dem script nicht geändert ... bitte um hilfe.


    //----------------------------------[Kick]------------------------------------------------
    if(strcmp(cmd, "/kick", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
    return 1;
    }
    new year, month,day;
    getdate(year, month, day);
    format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
    KickLog(string);
    Kick(giveplayerid);
    format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    return 1;
    }
    }
    }
    else
    {
    format(string, sizeof(string), " %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/skick", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /skick [playerid/PartOfName]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    Kick(giveplayerid);
    }
    }
    }
    else
    {
    format(string, sizeof(string), " %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/kickres", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if (PlayerInfo[playerid][pAdmin] < 1)
    {
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kickres [level] [ammount]");
    return 1;
    }
    new level = strval(tmp);
    if(level < 0 || level > 5) { SendClientMessage(playerid, COLOR_GREY, " Can only Reserved Slots Kick from level 0 to 5 !"); return 1; }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kickres [level] [ammount]");
    return 1;
    }
    new ammount = strval(tmp);
    if(ammount < 1 || ammount > 10) { SendClientMessage(playerid, COLOR_GREY, " Can only Reserved Slots Kick of a maximum of 10 players !"); return 1; }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pLevel] == level && PlayerInfo[i][pAdmin] < 1 && PlayerInfo[i][pDonateRank] < 1 && ammount > 0)
    {
    ammount -= 1;
    Kick(i);
    }
    }
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/warn", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /warn [playerid/PartOfName] [reason]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /warn [playerid/PartOfName] [reason]");
    return 1;
    }
    PlayerInfo[giveplayerid][pWarns] += 1;
    if(PlayerInfo[giveplayerid][pWarns] >= 3)
    {
    new year, month,day;
    getdate(year, month, day);
    format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
    BanLog(string);
    format(string, sizeof(string), "AdmCmd: %s was banned by %s (had 3 Warnings), reason: %s", giveplayer, sendername, (result));
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
    PlayerInfo[giveplayerid][pLevel] = -999;
    Ban(giveplayerid);
    return 1;
    }
    format(string, sizeof(string), "You warned %s, reason: %s", giveplayer, (result));
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    format(string, sizeof(string), "You were warned by %s, reason: %s", sendername, (result));
    SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
    return 1;
    }
    }//not connected
    }
    else
    {
    format(string, sizeof(string), " %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/sban", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /sban [playerid/PartOfName] [reason]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /sban [playerid/PartOfName] [reason]");
    return 1;
    }
    new year, month,day;
    getdate(year, month, day);
    format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
    BanLog(string);
    PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
    PlayerInfo[giveplayerid][pLevel] = -999;
    Ban(giveplayerid);
    return 1;
    }
    }//not connected
    }
    else
    {
    format(string, sizeof(string), " %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/ban", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]");
    return 1;
    }
    new year, month,day;
    getdate(year, month, day);
    format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
    BanLog(string);
    format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, (result));
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    PlayerInfo[giveplayerid][pAdmin] = PlayerInfo[giveplayerid][pLevel];
    PlayerInfo[giveplayerid][pLevel] = -999;
    Ban(giveplayerid);
    return 1;
    }
    }//not connected
    }
    else
    {
    format(string, sizeof(string), " %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }

  • if(strcmp(cmd, "/kick", true) == 0)
    {
    if(IsPlayerConnected(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
    return 1;
    }
    new year, month,day;
    getdate(year, month, day);
    format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
    KickLog(string);
    Kick(giveplayerid);
    format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    return 1;
    }
    }
    else
    {
    format(string, sizeof(string), " %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }


    so müsste es gehen, mach das bei den anderen commands auch


    //Edit:
    äh Sorry das war falsch
    hab IsPlayerConnected(playerid) mit isplayeradmin verwechselt