Gettime problem
#1

The time is not loading,when i use /reports it doesn't show me log i tried removing gettime and it worked fine,what is the problem?

Код:
CMD:report(playerid,params[])
{
	new string[256],reason[124],targetid,pName[MAX_PLAYER_NAME],pName1[MAX_PLAYER_NAME];
	new reportstring[128],pIP[16];
	new Hour,Minute,Second;
	if(sscanf(params,"us[128]",targetid,reason))
	return SendClientMessage(playerid,STEALTH_ORANGE,"USAGE: /report [id] [reason]");
	if(!IsPlayerConnected(targetid))
	return SendClientMessage(playerid,STEALTH_BLUE,"That player is not connected!");
	GetPlayerName(playerid,pName,sizeof pName);
	GetPlayerName(targetid,pName1,sizeof pName1);
	GetPlayerIp(targetid,pIP,sizeof pIP);
	gettime(Hour,Minute,Second);
	format(reportstring,sizeof(reportstring),"{FF0000}[NEW REPORT] [%02d:%02d:%02d] {3399FF}Player %s(%d) has reported %s(%d) || %s || for {FF0000}%s.",Hour,Minute,Second,pName,playerid,pName1,targetid,pIP,reason);
	MessageToAdmins(COLOR_MENUHIGHLIGHT,reportstring);
	format(string,sizeof(string),"{3399FF}You have reported %s(%d) for {FF0000}%s {3399FF}our admins will check it asap.",pName,targetid,reason);
	SendClientMessage(playerid,COLOR_MENUHIGHLIGHT,string);
	ReportLog(reportstring);
	GotReported = targetid;
	SentReport = playerid;
	return 1;
}


CMD:reports(playerid,params[])
{
    new reportstring[512];
    if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 1 to check reports.");
    new File:rFile = fopen("Reports/Report.txt",io_read),counter,i;
    while(fread(rFile,reportstring)) counter++;
    fclose(rFile),rFile=fopen("Reports/Report.txt",io_read);
    SendClientMessage(playerid,COLOR_MENUHIGHLIGHT,"------------------------[ LATEST REPORTS ]------------------------");
    while(fread(rFile,reportstring,sizeof reportstring, false))
    {
        if(i >= (counter-0x5))
        {
            format(reportstring,sizeof(reportstring),"%s",reportstring);
	    	SendClientMessage(playerid,COLOR_MENUHIGHLIGHT,reportstring);
		}
        i++;
    }
    fclose(rFile);
    return 1;
}
Reply


Messages In This Thread
Gettime problem - by Nabster - 06.03.2015, 02:53
Re: Gettime problem - by X337 - 06.03.2015, 02:58
Re: Gettime problem - by Nabster - 06.03.2015, 03:03
Re: Gettime problem - by X337 - 06.03.2015, 03:07
Re: Gettime problem - by Nabster - 06.03.2015, 03:12

Forum Jump:


Users browsing this thread: 1 Guest(s)