AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Admin Connect Logs (https://forums.alliedmods.net/showthread.php?t=325524)

alferd 06-26-2020 05:08

Admin Connect Logs
 
7 Attachment(s)
Admin Connect Logs
Version 1.5

Description:
Using this plugin, you can check the activity of managers (Admins) in your server
All details are stored in the following file, And you can check the specifications in this files
Code:

addons/amxmodx/configs/Connect_log/Connect_log-xxxxxxxx.log
And Disconnect:
Code:

addons/amxmodx/configs/Connect_log/Disconnect_log-xxxxxxxx.log
With the following command, you can watch the list of admins that entered the server in your "console"
  • amx_connect_info
( Show File ( addons/amxmodx/configs/Connect_log/Connect_log-xxxxxxxx.log ) in the console )


File save date code by : +ARUKARI-
PHP Code:

formatex    (szLog,     charsmax(szLog), szLogFileszTime    ); 

File Info code by : fysiks ( Edited By Me: AlferD )
Code:
    new usersfile[64], data[128]     get_configsdir(usersfile, sizeof(usersfile) - 1)     add(usersfile, sizeof(usersfile) - 1, "/users.ini")         new f = fopen(usersfile, "rt")     if(f)     {         while( fgets(f, data, charsmax(data)) )         {             trim(data)             if( !data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/' ) continue;                         console_print(id, data);         }         fclose(f)     }

Requirements:
  • AMX Mod X 1.8.2 and up

  • Non-Steam is not supported.

alferd 06-26-2020 09:27

Re: Admin Connect Logs
 
VERSION 1.1
  • Change Log File
  • Added Log File Info By Console

alferd 07-06-2020 05:22

Re: Admin Connect Logs
 
VERSION 1.5
  • Added Disconnect Log

fysiks 07-06-2020 21:38

Re: Admin Connect Logs
 
You don't need to give credit for trivial code and you don't need to include the code in the forum post. If you want to give credit to someone about a section of code, put it as a comment in your plugin and then in your forum post, you can simply mention the names of people that helped you. Having the credit in the source code is the most important. IMO, mentioning it in the forum post in just extra. I know that you're trying to give credit because others told you to give credit but it all really depends on how trivial the code is or how much you transformed it. The code that I gave you should be considered trivial since it doesn't really do anything unique. So, you can remove both credits you have in this plugin (as of right now).

About your code: Stop using tabs everywhere!!! It's terrible for readability and it's extremely annoying. Only use tabs for indentation, tabs are never needed anywhere else in AMX Mod X plugin source code.

+ARUKARI- 07-06-2020 22:05

Re: Admin Connect Logs
 
I also use Tab a lot, but this is what your code looks like when I write it.
https://f.easyuploader.app/eu-prd/up...4a31335634.png
https://f.easyuploader.app/eu-prd/up...4a31335634.png
=>
https://f.easyuploader.app/eu-prd/up...4556706e68.png
https://f.easyuploader.app/eu-prd/up...4556706e68.png

Foxa 07-08-2020 08:31

Re: Admin Connect Logs
 
@+ARUKARI- Yeah but your tabs make sense, unlike his, like what is this??

PHP Code:

new fopen    (    g_LogFile,     "rt"                        ); 

People tried to explain to him that using tabs the way he uses them is not good, still he doesn't want to listen..

alferd 07-08-2020 09:12

Re: Admin Connect Logs
 
fixed

HamletEagle 07-08-2020 09:32

Re: Admin Connect Logs
 
I know you probably think we are picking on you or no matter what you do is still not good, but that's not true. We are just trying to help, so I'll say this: as fysiks already pointed out, you don't need to give credits for individual lines of code or code that has nothing special. Give credit when you take a complex function or a considerable amount of code from someone else.
Anyone could come up with that formatex line and write it just like +ARUKARI- did.
Anyone could come up with the code you took from fysiks.
It's basic file reading code.

alferd 07-08-2020 11:11

Re: Admin Connect Logs
 
Quote:

Originally Posted by HamletEagle (Post 2709249)
Give credit when you take a complex function or a considerable amount of code from someone else.

ooo I didn't understand what fysiks meant, Now I understand


All times are GMT -4. The time now is 18:03.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.