SA-MP Forums Archive
[Include] Log Files Functions. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Log Files Functions. (/showthread.php?tid=548785)



Log Files Functions. - _Application_ - 02.12.2014

aLog Files

Код:
        native CreateLog(const logname[]) - This function is used to create log.
        native WriteInLog(const logname[], string) - This function is used to write in log file.
        native DeleteLog(const logname) - This function is used to delete the log file.
:Example
Код:
#include <a_samp>
#include <aLog_Files>

new pName[MAX_PLAYERS][MAX_PLAYER_NAME+1];

public OnGameModeInit()
{
    CreateLog("connect");
    return 1;
}

public OnPlayerConnect(playerid)
{
    new string[64];
    GetPlayerName(playerid, pName[playerid], MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s has joined the server.", pName[playerid]);
    WriteInLog("connect", string);
    return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
    DeleteLog("connect");
    return 1;
}
Download
aLog_Files.inc



Re: Log Files Functions. - LorDWarS - 02.12.2014

good job Gavriel!


Re: Log Files Functions. - Excips - 05.12.2014

Pretty simple but keep up.