How to create mysql log - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to create mysql log (
/showthread.php?tid=190436)
How to create mysql log -
NewbBeginner - 15.11.2010
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 !
Re: How to create mysql log -
Scenario - 15.11.2010
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);
}
Re: How to create mysql log -
NewbBeginner - 15.11.2010
And what should I add under the command ?
Re: How to create mysql log -
Scenario - 15.11.2010
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 **");