Another log file for special cmd. -
fuem1907 - 29.07.2012
Hello there,
As you know there's a log file that saves everything that happens in your server, but I want another log file which gonna save every bans and reasons. for example, when some admin uses /ban cmd, he needs to type like; /ban [reason] and when he bans someone, it'll be automatically saved to the notepad file in the server documents. And IT'll be like;
Admin Fred has banned "playerid" Reason: "reason", Date:"date" Is that possible? Thank you from now.
I also need when someone gets killed, I want every kills in another log file, which will show like;
"Killer's Name" has killed "who got killed" with "weaponname" date:"date"
Re: Another log file for special cmd. -
Revo - 29.07.2012
https://sampwiki.blast.hk/wiki/File_Functions
Re: Another log file for special cmd. -
fuem1907 - 29.07.2012
Well, I have no idea about pawn, if that's not hard, could you just write that code for me? Kill LOGS and Ban logs
Respuesta: Re: Another log file for special cmd. -
HarlemSAMP - 29.07.2012
Quote:
Originally Posted by fuem1907
Well, I have no idea about pawn, if that's not hard, could you just write that code for me? Kill LOGS and Ban logs
|
Never is too late to learn something new!
Re: Another log file for special cmd. -
fuem1907 - 29.07.2012
Well, Ofc I'd like to learn somethings new about pawno but my own language is not english, so I'm not good with reading all of them, one mistake = blows everything.
Re: Another log file for special cmd. -
iggy1 - 29.07.2012
A small function.
pawn Код:
stock WriteLog(szFilePath[], szData[])
{
new
szBuffer[512],//increase/decrease the size of this array if needed
File: LogFile = fopen( szFilePath, io_write )
;
if( fexist( szFilePath ) )
{
strcat(szBuffer, szData);
strcat(szBuffer, "\r\n");
fwrite(LogFile, szBuffer);
fclose(LogFile);
return 1;
}
return 0;
}
USAGE:
pawn Код:
WriteLog("BANLOG.txt", "Noob was banned by (noob-banner)");
Re: Another log file for special cmd. -
fuem1907 - 29.07.2012
thank you, is this including ban reason?
Re: Another log file for special cmd. -
fuem1907 - 29.07.2012
I'd be so appreciete if you guys help me about these logs.
Re: Another log file for special cmd. -
iggy1 - 29.07.2012
The first argument to the function is the file you wish to write to, and the second argument is the string to write to the file (reason).
You make the reason in your ban command, and use this function to write it to file.
Re: Another log file for special cmd. -
fuem1907 - 29.07.2012
Oh I thought
WriteLog("BANLOG.txt", "Noob was banned by (noob-banner)"); with this it doesnt says the reason for getting banned, but as I said I dont know anything about pawno, so
thank you very much, can you do the same think about kill logs if you have free time please? I'm really in trouble with these