Question.
#1

Hi all,i maked this custom code for the ban function:

Код:
dcmd_b(playerid, params[])
{
     if(PlayerInfo[playerid][AdminLevel] > 2)
    {
        new toplayerid, reason[ 128 ];
        if (sscanf(params, "us[128]", toplayerid, reason))
        {
            SendClientMessage(playerid, 0xAA3333AA, "Syntax Error: /b < Playerid > < Reason >");
            return 1;
        }
        if (toplayerid == INVALID_PLAYER_ID)
        {
            SendClientMessage(playerid, 0xAA3333AA, "Input Error: Player is not connected or it is yourself.");
            return 1;
        }
        new banString[128], adminName[24], bannedName[24];
        GetPlayerName(playerid, adminName, 24);
        GetPlayerName(toplayerid, bannedName, 24);
        format(banString, 128, "Player %s was banned by Administrator %s. Reason: %s.", bannedName, adminName, reason);
        SendClientMessageToAll(0xAA3333AA, banString);
        new str[100];
   	    format(str,sizeof str,"0,4Player %s was banned by Administrator %s. Reason: %s", bannedName, adminName, reason);
   	   	IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
		BanLog(banString);
        Ban(toplayerid);
    }
    return 1;
}
I need to add,when some admin ban a player,the name banned will be added to a file. (Ex: bannednames.txt)

Thanks.
Reply


Messages In This Thread
Question. - by Face9000 - 20.12.2010, 17:04
Re: Question. - by blackwave - 20.12.2010, 17:12
Re: Question. - by Face9000 - 20.12.2010, 17:13
Re: Question. - by blackwave - 20.12.2010, 17:15
Re: Question. - by Face9000 - 20.12.2010, 17:18
Re: Question. - by Seven. - 20.12.2010, 17:19
Re: Question. - by Face9000 - 20.12.2010, 17:20
Re: Question. - by Face9000 - 20.12.2010, 17:38

Forum Jump:


Users browsing this thread: 1 Guest(s)