Restricted Commands
#2

Yeah, I think I somehow know what you want! You'd need to create a log for that:

pawn Код:
#define gatePATH    "Logs/GateLog.txt" //directory for the log of gates
Then, under a command, simply you could write into the log which you created, while creating a stock for your function:

pawn Код:
stock GateLog(Target)
            {
                new File:Log = fopen(gatePATH, io_append);
                new logData[128];
                new name[MAX_PLAYER_NAME];
                GetPlayerName(Target,name,sizeof(name));
                new fTime[6];
                getdate(fTime[0], fTime[1], fTime[2]);
                gettime(fTime[3], fTime[4], fTime[5]);
                format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s performed an ACTION!\r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], name);
                fwrite(Log, logData);
                fclose(Log);
                return 1;
            }
Under your command, you could use this function then simply with one line:

pawn Код:
GateLog(playerid);
Reply


Messages In This Thread
Restricted Commands - by Jack- - 05.03.2012, 17:42
Re: Restricted Commands - by Twisted_Insane - 05.03.2012, 17:58
Re: Restricted Commands - by Jack- - 05.03.2012, 18:17
Re: Restricted Commands - by Twisted_Insane - 05.03.2012, 18:52

Forum Jump:


Users browsing this thread: 2 Guest(s)