24.06.2013, 21:59
I need a ban IP for Y_INI command.
Please if anyone could help me doing it with saving the reason..
pawn Код:
enum pInfo
{
pPass,
pCash,
pScore,
pAdmin,
pHeals,
pKills,
pDeaths,
pNameBanned,
pIPBanned
}
dcmd_ban(playerid,params[])
{
new string[128];
new ID;
new cmdreason[100];
new pname[MAX_PLAYER_NAME];
new tname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(ID,tname,sizeof(tname));
if(sscanf(params,"us[100]",ID,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /Ban (Player Name/ID) (Reason)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"[ERROR] The player ID you entered is not connected to the server.");
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
format(string, sizeof(string), "~r~BANNED!");
GameTextForPlayer(ID, string, 3000, 1);
format(string,sizeof(string),"[BANNED] An Administrator has banned you from the server. [Reason: %s]",cmdreason);
SendClientMessage(ID,COLOR_RED,string);
format(string,sizeof(string),"[ADMIN BAN] Administrator has banned %s(%d). [Reason: %s]",tname,ID,cmdreason);
SendClientMessageToAll(COLOR_PINK,string);
format(string,sizeof(string),"9[ADMIN BANNED] Administrator has kicked banned. [Reason: %s]",tname,ID,cmdreason);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
format(string,sizeof(string),"[ADMIN RADIO] Administrator %s(%d) has banned %s(%d). [Reason: %s]",pname,playerid,tname,ID,cmdreason);
SendAdminMessage(COLOR_PINK,string);
IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
PlayerInfo[ID][pNameBanned] = PlayerInfo[ID][pNameBanned] =1;
PlayerInfo[ID][pIPBanned] = PlayerInfo[ID][pIPBanned] =1;
SetTimerEx("KickPlayer",1000,false,"i",ID);
return 1;
}