Remove Warning command (Ladmin) +Rep
#6

I am only begginer and in my knowldge this think should work
pawn Код:
CMD:remwarn(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 2) {
        new tmp[128], tmp2[128], Index;     tmp = strtok(params,Index), tmp2 = strtok(params,Index);
        if(isnull(tmp) || isnull(tmp2)) return SendClientMessage(playerid,LIGHTBLUE2, "Usage: /RemWarn [PlayerID]") && SendClientMessage(playerid,orange, "Function: Will remove a warning from a specified player");
        new warned = strval(tmp), str[128];
        if(PlayerInfo[warned][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(warned) && warned != INVALID_PLAYER_ID) {
            if(warned != playerid) {
                CMDMessageToAdmins(playerid,"Warn");
                PlayerInfo[warned][Warnings]--;
                if( PlayerInfo[warned][Warnings] == MAX_WARNINGS) {
                    format(str, sizeof (str), "4|- Administrator \"%s\" has kicked \"%s\".(Warnings: %d/%d) -|", pName(playerid), pName(warned), PlayerInfo[warned][Warnings], MAX_WARNINGS);// I change here
                    IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
                    IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, str);
                    format(str, sizeof (str), "|- Administrator \"%s\" has kicked \"%s\". (Warnings: %d/%d) -|", pName(playerid), pName(warned), PlayerInfo[warned][Warnings], MAX_WARNINGS);// I change here
                    SendClientMessageToAll(red, str);
                    SaveToFile("KickLog",str);  Kick(warned);
                    return PlayerInfo[warned][Warnings] = 0;
                } else {
                    format(str, sizeof (str), "8|- Administrator \"%s\" has removed a warning from \"%s\" | (Warnings: %d/%d) -|", pName(playerid), pName(warned), PlayerInfo[warned][Warnings], MAX_WARNINGS);
                    IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
                    IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, str);
                    format(str, sizeof (str), "|- Administrator \"%s\" has removed a warning from \"%s\" | (Warnings: %d/%d) -|", pName(playerid), pName(warned), PlayerInfo[warned][Warnings], MAX_WARNINGS);
                    return SendClientMessageToAll(yellow, str) && SaveToFile("WarnLog",str);
                }
            } else return SendClientMessage(playerid, red, "ERROR: You cannot remove your own warnings");
        } else return SendClientMessage(playerid, red, "ERROR: Player is not connected");
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)