06.10.2014, 03:04
Code:
PHP код:
stock BanPlayerTemp(playerid,reason[],admin[],hours[],minutes[])
{
new ppp[50];
new exp=gettime()+(60*minutes)+(60*60*hours); //error line
GetPlayerIp(playerid,ppp,sizeof(ppp));
new INI:File = INI_Open(UserBanPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Banexp",exp);
INI_WriteInt(File,"BanPerm",0);
INI_WriteString(File,"BanAdmin",admin);
INI_WriteString(File,"Reason",reason);
INI_WriteString(File,"IP",ppp);
INI_Close(File);
new banmt[300],targetn[MAX_PLAYER_NAME];
GetPlayerName(playerid,targetn,sizeof(targetn));
new INI:iFile = INI_Open(UserIPPath(playerid));
INI_SetTag(iFile,"data");
INI_WriteInt(iFile,"Banexp",exp);
INI_WriteInt(iFile,"BanPerm",0);
INI_WriteString(iFile,"BanPlayer",targetn);
INI_WriteString(iFile,"BanAdmin",admin);
INI_WriteString(iFile,"Reason",reason);
INI_Close(iFile);
new File:logg=fopen("BannedPlayers.txt",io_append);
fwrite(logg, targetn);
fwrite(logg,"\n");
fclose(logg);
format(banmt,sizeof(banmt),"{DC143C}Admin %s has banned you for %i hours %i minutes due to %s",admin,hours,minutes,reason);
SendClientMessage(playerid,-1,banmt);
SetTimerEx("KickPlayer",100,false,"i",playerid);
}