Y_INI Ban Reason Save?
#1

I use the following system to ban a player from my server.

Код:
CMD:ban(playerid, params[])
{
    if(pInfo[playerid][Adminlevel] >= 1) {
        new PID;
        new reason[64];
        new str[128];
        new str2[128];
        new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Adminname, sizeof(Adminname));
  		GetPlayerName(PID, Playername, sizeof(Playername));
        if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]");

        if(!IsPlayerConnected(PID))
            return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");

        format(str, sizeof(str), "'%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason);
		SendClientMessageToAll(COLOR_RED, str);
		format(str2, sizeof(str), "You have been banned by administrator '%s'. Reason: %s ", Adminname, reason);
		SendClientMessage(PID, COLOR_RED, str2);
		SendClientMessage(PID, COLOR_RED, "TAKE A SCREENSHOT IMMEDIATELY AND USE TO APPEAL YOUR BAN @ LS-CW.ML/FORUM");
		Ban(PID);
    }
	else
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command!");
    }
    return 1;
}
How can I make the player's name, the admins name, and the reason for the ban store to a file.

ALSO, I would like in game admins to be able to search for the ban reason in game, like /searchban Sebz, and if Sebz is banned, the admin would get a message with the ban reason.

Anyone who can help me do this will receive reputation and my deepest thanks for your time!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)