[HELP]How To Make A Remove Warning Command?
#10

Untested, but you get the idea.
pawn Код:
dcmd_clearwarn(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 2 || AccInfo[playerid][pVip] > 3)
    {
        new Index;
        new tmp[256];  tmp  = strtok(params,Index);

        if(!strlen(tmp) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /clearwarn [PlayerID]") &&
        SendClientMessage(playerid, orange, "Function: Will clear all Warnings for a specified player");
        new warned = strval(tmp);
        new str[128];
        if(AccInfo[warned][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
        return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(warned) && warned != INVALID_PLAYER_ID)
         {
 
                format(str, sizeof (str), "***Administrator \"%s\" has cleared\"%s\"  Warnings", pName(playerid), pName(warned));
AccInfo[ warned][ Warnings ] = 0;
                return SendClientMessageToAll(yellow, str);
               
            }
            else return SendClientMessage(playerid, red, "ERROR: You cannot warn yourself");
        }
        else return ErrorMessages(playerid, 2);
    }
    else return ErrorMessages(playerid, 1);
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)