Код:
CMD:tempban(playerid,params[])
{
if(pInfo[playerid][pLevel] >= 2)
{
new id, reason[50], Jfile[100];
new year,month,day,hour,minuite,second,Hours,BanTime,d,h,m,Temp;
if(sscanf(params, "uis[50]", id, Hours, reason)) return SCM(playerid, yellow, "SERVER :: /tempban <Player ID> <Hours> <Reason>");
if(IsPlayerConnected(id) && id != playerid)
{
if(pInfo[playerid][pLevel] <= pInfo[id][pLevel]) return ShowMessage(playerid, red, 6);
getdate(year, month, day);
gettime(hour,minuite,second);
BanTime = gettime() + (Hours*60*60);
if(pInfo[id][Logged] == 1)
{
format(Jfile, 100, ACCOUNTS_PATH, GetName(id));
new INI:ACCOUNT = INI_Open(Jfile);
INI_WriteInt(ACCOUNT, "TempBan", BanTime);
INI_Close(ACCOUNT);
}
Temp = BanTime - gettime();
format(Jstring,sizeof(Jstring),"%s has been Temporarily Banned by Administrator %s for %s | Reason: %s <Date: %d/%d/%d> <Time: %d:%d>",GetName(id),GetName(playerid),ConvertTime(Temp,m,h,d),reason,day,month,year,hour,minuite);
SCMToAll(red,Jstring);
Temp = BanTime - gettime();
format(JLstring,sizeof(JLstring),"{37C8C8}Administrator %s has Temp banned you for %s REASON |: \"%s\"\n\nVisit "WEBSITE" for more informations", GetName(playerid),ConvertTime(Temp,m,h,d),reason);
ShowPlayerDialog(id,JDIALOGS+200,DIALOG_STYLE_MSGBOX," {FF0000}You are BANNED",JLstring,"OK","");
format(Jstring,sizeof(Jstring),"[TEMP BAN] %s has Temp banned %s for %s | reason: ",GetName(playerid),GetName(id),ConvertTime(BanTime,m,h,d),reason);
WriteToLog(Jstring,"Bans");
CommandToAdmins(playerid,"tempban");
return SetTimerEx("KickPlayer",100,false,"d", id);
}
else return ShowMessage(playerid, red, 3);
}
else return ShowMessage(playerid, red, 1);
}
[10:07:49] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe
[10:07:49] [debug] #3 00005d50 in public OnPlayerCommandText (0x00000000, 0x0148b9f0) from GM.amx
Server Crashed when any admin try to ban anyone.