Any way to adminlog?
#9

It won't cause you any harm if you run 5-10 queries every second.

Another smart way can be using a 2D array and fill it up with admin log until it gets full. Once the array is full, you save the log from array to database and then empty it and do the process again.

A rough look at what i mean:
PHP код:
#define MAX_ADMIN_LOGS 1000 // how many logs can the array hold
#define MAX_ADMIN_LOG_STRING 144 // max length of log string
new adminLogs[MAX_ADMIN_LOGS][MAX_ADMIN_LOG_STRING];
new 
adminLogCount// this var is to keep track of number of logs
// create a function to write admin log
WriteAdminLog(const text[]) {
    if (
adminLogCount == MAX_ADMIN_LOGS) {
        
// array is full
        // we loop through 1000 logs (or whatever you set the limit) and run 1000 queries to save into database
        
for (new 0MAX_ADMIN_LOGSi++) {
            
// write query to save log for "adminLogs[i]"
        
}
        
// clear the count
        
adminLogCount 0;
    }
   
    
// here we fill the array
    
format(adminLogs[adminLogCount++], MAX_ADMIN_LOG_STRINGtext);

That's all you need for the second method!
Reply


Messages In This Thread
Any way to adminlog? - by Zeus666 - 20.09.2018, 21:29
Re: Any way to adminlog? - by solstice_ - 20.09.2018, 21:30
Re: Any way to adminlog? - by Zeus666 - 20.09.2018, 21:31
Re: Any way to adminlog? - by solstice_ - 20.09.2018, 21:32
Re: Any way to adminlog? - by KinderClans - 20.09.2018, 21:48
Re: Any way to adminlog? - by Zeus666 - 20.09.2018, 21:55
Re: Any way to adminlog? - by KinderClans - 20.09.2018, 21:57
Re: Any way to adminlog? - by Zeus666 - 20.09.2018, 22:00
Re: Any way to adminlog? - by Gammix - 20.09.2018, 22:28

Forum Jump:


Users browsing this thread: 2 Guest(s)