if(IsPlayerAdmin(playerid) || pInfo[playerid][aAdmin] >= 1)
{
new id, reason[50];
new year,month,day,hour,minuite,second,Hours,BanTime,d,h,m,Temp;
if(sscanf(params, "uis[50]", id, Hours, reason)) return SendClientMessage(playerid, red, "Usage: /tempban <Player ID> <Hours> <Reason>");
{
getdate(year, month, day);
gettime(hour,minuite,second);
BanTime = gettime() + (Hours*60*60);
if(pInfo[id][Logged] == 1)
{
format(UserPath(playerid), 100, PATH, GetName(id));
new INI:ACCOUNT = INI_Open(UserPath(playerid));
INI_WriteInt(ACCOUNT, "TempBan", BanTime);
INI_Close(ACCOUNT);
}
Temp = BanTime - gettime();
format(astring,sizeof(astring),"%s has been Temporarily Banned by An Administrator ,for %s | Reason: %s <Date: %d/%d/%d> <Time: %d:%d>",GetName(id),ConvertTime(Temp,m,h,d),reason,day,month,year,hour,minuite);
SendClientMessageToAll(red,astring);
Temp = BanTime - gettime();
format(anstring,sizeof(anstring),"{37C8C8}Administrator %s has Temp banned you for %s REASON |: \"%s\"\n\n", GetName(playerid),ConvertTime(Temp,m,h,d),reason);
ShowPlayerDialog(id,DIATEMPBAN,DIALOG_STYLE_MSGBOX,"You are Temporarily BANNED",anstring,"OK","");
format(astring,sizeof(astring),"[TEMP BAN] %s has Temporarily banned %s for %s | reason: ",GetName(playerid),GetName(id),ConvertTime(BanTime,m,h,d),reason);
WriteToLog(astring,"Bans");
CommandToAdmins(playerid,"tempban");
return SetTimerEx("KickPlayer",100,false,"d", id);
}
}
else return ShowMessage(playerid, red, 1);
}
format(UserPath(playerid), 100,PATH, GetName(playerid));
INI_ParseFile(UserPath(playerid), "Playerinfor", .bExtra = true, .extra = playerid);
if(pInfo[playerid][TempBan] >= gettime())
{
new minu, hour ,day, sec = pInfo[playerid][TempBan] - gettime();
format(astring, sizeof(astring), "You are temporarily banned more %s",ConvertTime(sec,minu,hour,day));
ShowPlayerDialog(playerid, DIATEMPBAN, DIALOG_STYLE_MSGBOX," {FB0404}You are temp baned", astring, "Ok", "");
SetTimerEx("KickPlayer",100,false,"d", playerid);
format(astring, sizeof(astring),"\"%s\" has been automatically kick | reason: 'Player is Temporarily banned'", GetName(playerid));
SendToAdmins(orange,astring);
}
else if(pInfo[playerid][TempBan] > 0)
{
new year,month,day;
getdate(year,month,day);
SendClientMessage(playerid,green,"Your tempbanned period has been expired! welcome back");
format(astring,sizeof(astring),"[EXPIRED on %d/%d/%d]",year,month,day);
format(UserPath(playerid), 100, PATH, GetName(playerid));
new INI:ACCOUNT = INI_Open(UserPath(playerid));
INI_WriteString(ACCOUNT, "TempBan", astring);
INI_Close(ACCOUNT);
pInfo[playerid][TempBan] = 0;
}
forward Playerinfor(playerid,name[],value[]);
public Playerinfor(playerid, name[], value[])
{
INI_Int("Banned", pInfo[playerid][Banned]);
INI_Int("TempBan", pInfo[playerid][TempBan]);
return 1;
}
INI_WriteInt(ACCOUNT, "TempBan", BanTime);
INI_WriteInt(ACCOUNT, "TempBan", pInfo[playerid][TempBan]);
What is this?
PHP код:
PHP код:
|
if(fexist(UserPath(playerid)))