11.10.2011, 23:12
I dont know how to create the file in the mode, how it will write there the ip of the banned player o.o
This is going to the samp.ban file...
PHP код:
if(strcmp(cmd,"/banip",true)==0)
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
new ip[256];
ip = strtok(cmdtext,idx);
if(!strlen(ip))
{
SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /banip [players ip]");
return 1;
}
if(strcmp(ip,"93.172.235.134",true) == 0 || strcmp(ip,"5.75.85.197", true) == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Please do not ban the Scripter..");
format(string,sizeof(string),"banip %s",ip);
SendRconCommand(string);
SendRconCommand("reloadbans");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "AdmWarning: %s has banned IP %s", sendername,ip);
ABroadCast(COLOR_YELLOW,string,1);
}
return 1;
}
PHP код:
format(string,sizeof(string),"banip %s",ip);
SendRconCommand(string);