18.11.2017, 03:01
Each time i use this command that i have made it crashes the server, idk why
PHP код:
CMD:tempban(playerid,params[])
{
if(IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 1)
{
new id,reason[50],time;
new hourb, minb, secb;
gettime(hourb,minb,secb);
new yearb, monthb, dayb;
getdate(yearb,monthb,dayb);
if(sscanf(params,"us[50]i",id,reason,time)) return SendClientMessage(playerid,-1,"Usage : /tempban (id) (reason) (time)");
pInfo[id][BanTime] = gettime();
pInfo[id][BanDay] = 60*60*24* time;
pInfo[id][Banned] = 1;
new INI:File = INI_Open(UserPath(id));
INI_SetTag(File,"data");
INI_WriteString(File,"BanReason",reason);
INI_WriteString(File,"Banby",GetName(playerid));
INI_Close(File);
new message[128];
format(message, sizeof(message), "[AdmCmd]:{FF6347}%s has been Temporarily Banned from the server. | Reason: %s || Time: %d Day(s)", GetName(id), reason, time);
SendClientMessageToAll(red, message);
SendClientMessage(id,red,"=====================================================");
SendClientMessage(id,red,"{FF6347}You have been Banned from Caribbean Mafia Warz.");
format(message, sizeof(message),"Your Name: %s - Your IP: %s",GetName(playerid), pIP);
SendClientMessage(id,-1,message);
format(message, sizeof(message),"Banned by: %s ", GetName(playerid));
SendClientMessage(id,-1,message);
format(message, sizeof(message),"Banned Reason: %s ", reason);
SendClientMessage(id,-1,message);
format(message, sizeof(message),"Unban in %d Day(s)",time );
SendClientMessage(id,-1,message);
format(message, sizeof(message),"Date: %d/%d/%d || Time: %d:%d:%d",dayb,monthb,yearb,hourb,minb,secb );
SendClientMessage(id,-1,message);
SendClientMessage(id,red,"{FF6347}Visit our forums at: "SERVER_FORUMS" - ScreenShot is required for an appeal.");
SendClientMessage(id,red,"=====================================================");
SendClientMessage(id,red,"{FF6347}Server Administrators has been notified.");
SetTimerEx("BanPlayer",200,false,"ud", id,2);
}
else return ShowMessage(playerid, error, 1);
return 1;
}
/*