#1

Hi

Can someone tell me why my server crash when I ban someone



Код:
CMD:ban(playerid,params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
{
new id,file1[256],str[128];
if(sscanf(params, "u", id))return SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [playerid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Player is not connected!");
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
new ip[126];
GetPlayerIp(id, ip, sizeof(ip));
GetPlayerName(id, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day);
new hour,minuite,second; gettime(hour,minuite,second);
format(file1, sizeof(file1),BAN_LOG);
format(str,sizeof(str),"%s has been Banned by Administrator %s | [Date: %d/%d/%d] [Time: %d:%d]\r\n",playername,adminname,day,month,year,hour,minuite);
dini_Set(file1,"Ban",str);
BanIp(id);
}
else return Error(playerid, 5);
return 1;
}
Код:
stock BanIp(playerid)
{
PlayerInfo[playerid][Baned] = 1;
PlayerInfo[playerid][BanedTimes]++;
new ip[15];
new string[126];
new File:banedf = fopen("Server/Logs/BANNEDIPs.ban", io_append);
GetPlayerIp(playerid, ip, sizeof (ip));
ShowPlayerDialog(playerid,DIALOG_BAN2,DIALOG_STYLE_MSGBOX,""COL_GREEN"UGF",""COL_GREEN"You have been "COL_RED"banned "COL_GREEN"and you can request unban at "COL_WHITE"www.ugfforum.tk"COL_GREEN".\nTake a picture with "COL_WHITE"F8 "COL_GREEN"for proof.","KICK","");
format(string, sizeof string, "%s\r\n",ip);
fwrite(banedf, string);
fclose(banedf);
return 1;
}
Reply


Messages In This Thread
BAN - by kalanerik99 - 25.01.2015, 13:46
Re: BAN - by Ironboy - 25.01.2015, 15:13
Re: BAN - by kalanerik99 - 25.01.2015, 18:20
Re: BAN - by zaibaslr2 - 25.01.2015, 18:23
Re: BAN - by CalvinC - 25.01.2015, 18:23
Re: BAN - by kalanerik99 - 25.01.2015, 18:25
Re: BAN - by kalanerik99 - 31.01.2015, 13:10
Re: BAN - by kalanerik99 - 31.01.2015, 16:59
Re: BAN - by kalanerik99 - 01.02.2015, 10:08
Re: BAN - by BroZeus - 01.02.2015, 10:28

Forum Jump:


Users browsing this thread: 2 Guest(s)