16.05.2014, 17:56
pawn Код:
CMD:banip(playerid, params[]){
new tmp[50], string[128], idx, sendername[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, red, "USAGE: /banip [IP]");
return 1;
}
if(PlayerInfo[playerid][Level] >= 6)
{
format(string, sizeof(string), "banip %s", tmp);
SendRconCommand(string);
SendRconCommand("reloadbans");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Adminstrator %s has banned the IP %s", sendername, tmp);
SaveToFile("BanIPLog",string);
MessageToAdmins(white,string);
CMDMessageToAdmins(playerid,"BANIP");
}
else
{
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
return 1;
}
}
return 1;}