How to log command usages
#5

Opps my bad. Here our combined efforts(even though your effort was 90% more):

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
        if(success) 
        {
                LogPlayerCmd(playerid,cmdtext);
        }
        return 1;
}

stock LogPlayerCmd(playerid,cmdtext[])
{
    new name[MAX_PLAYER_NAME], file[80],fStr[90],tStr[30];
    GetPlayerName(playerid, name, sizeof(name));
    //
    new Hour, Minute, Second;
    gettime(Hour, Minute, Second);
    format(tStr,sizeof tStr,"[%02d:%02d:%02d]",Hour, Minute, Second);
    format(fStr,sizeof fStr,"%s: %s",name,cmdtext);
    //
    new INI:Acc = INI_Open("CmdLog.txt");
    INI_WriteString(Acc,tStr, fStr);
    INI_Close(Acc);
    return 1;
}
This way you dont have to add that line under every command .
Reply


Messages In This Thread
How to log command usages - by Tamer - 06.01.2013, 10:26
Re: How to log command usages - by park4bmx - 06.01.2013, 10:36
Re: How to log command usages - by eesh - 06.01.2013, 10:53
Re: How to log command usages - by park4bmx - 06.01.2013, 10:56
Re: How to log command usages - by eesh - 06.01.2013, 10:59
Re: How to log command usages - by Tamer - 06.01.2013, 11:04
Re: How to log command usages - by Mr.Anonymous - 06.01.2013, 11:07
Re: How to log command usages - by Tamer - 06.01.2013, 11:11

Forum Jump:


Users browsing this thread: 4 Guest(s)