How to create mysql log
#1

How to create log like if I use command /kick , then it saves this command somehow into mysql database ?
Like adminlog or something .

Please help !
Reply
#2

You will need to edit this of course, to match your database.

pawn Код:
stock AdminLog(adminname[], playername[], action[], reason[])
{
    new hour, minute, second, year, month, day;
    getdate(year, month, day);
    gettime(hour, minute, second);

    format(Query, sizeof(Query), "INSERT INTO `Admin Logs` (`AdminName`, `PlayerName`, `Action`, `Reason`, `Date`, `Time`) VALUES('%s', '%s', '%s', '%s', '%d/%d/%d', '%d:%d:%d')", adminname, playername, action, reason, month, day, year, hour, minute, second);
    mysql_query(Query);
}
Reply
#3

And what should I add under the command ?
Reply
#4

Quote:
Originally Posted by NewbBeginner
Посмотреть сообщение
And what should I add under the command ?
I made it in the following format;

Admin's Name > Player's Name > Action > Reason

You may wish to edit it a little bit.

pawn Код:
AdminLog(*admins name*, *players name*, "** ACTION **", "** REASON **");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)