AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved Request Last Maps Plugin [CS 1.6] (https://forums.alliedmods.net/showthread.php?t=342383)

WhiteFang1319 04-07-2023 07:22

Request Last Maps Plugin [CS 1.6]
 
Hey, I would love if someone can create a plugin that'll store maps played in a log file by date.
An admin can then use a command /lastmaps to get last maps played shown in chat.
A cvar to set how many maps to show would also be nice. Thanks!

BARRY. 04-07-2023 22:53

Re: Request Last Maps Plugin [CS 1.6]
 
Done. The list is shown to everyone when an admin types /lastmaps in chat.
I'll probably only do 1 or 2 more revisions, if needed.

CVars
amx_lastmaps_maxresults 10 - Total results showed ( capped at 20 )
amx_lastmaps_style <0/1> 1 - Table (max recommended: 4) / 1 - List (default)

Command
say /lastmaps - ADMIN_IMMUNITY flag required.

Deleted, will rework and reload.

WhiteFang1319 04-08-2023 12:11

Re: Request Last Maps Plugin [CS 1.6]
 
Quote:

Originally Posted by BARRY. (Post 2802339)
Done. The list is shown to everyone when an admin types /lastmaps in chat.
I'll probably only do 1 or 2 more revisions, if needed.

CVars
amx_lastmaps_maxresults 10 - Total results showed ( capped at 20 )
amx_lastmaps_style <0/1> 1 - Table (max recommended: 4) / 1 - List (default)

Command
say /lastmaps - ADMIN_IMMUNITY flag required.

Hi, I have installed the plugin and testing it. Using the command with style cvar 1 just returns the following
Code:

[AMXX] Last 10 Maps:


and with style 0


Code:


[AMXX] Last 10 Maps: 
1) 03/28/2020 00:14 
2) 03/28/2020 00:14 
3) 03/28/2020 00:14 
4) 03/28/2020 00:14 
5) 03/28/2020 00:13 
6) 03/28/2020 00:13 
7) 03/28/2020 00:13

Is it conflicting with other files? i'd like to store logs in amxmodx/logs/lastmaplogs/ for better management

BARRY. 04-09-2023 05:01

Re: Request Last Maps Plugin [CS 1.6]
 
I may have to rewrite the whole script. This method just parses the logs from 'addons\amxmodx\logs'.
Could you paste a sample of a log from that folder?

Mine looks like this:

Quote:

L 04/07/2023 - 20:06:41: -------- Mapchange to de_airstrip --------
L 04/07/2023 - 21:06:35: -------- Mapchange to de_inferno --------
L 04/07/2023 - 22:32:09: -------- Mapchange to de_mirage --------
L 04/07/2023 - 22:49:32: -------- Mapchange to de_inferno --------

WhiteFang1319 04-09-2023 08:33

Re: Request Last Maps Plugin [CS 1.6]
 
Quote:

Originally Posted by BARRY. (Post 2802419)
I may have to rewrite the whole script. This method just parses the logs from 'addons\amxmodx\logs'.
Could you paste a sample of a log from that folder?

Mine looks like this:


Thanks for the reply.. After reading it got me thinking I have lots of logs (from several years) which may have conflicted with the plugin, I have renamed the existing folder and restarted the server.
I'll test it again and get back to you.

WhiteFang1319 04-09-2023 12:14

Re: Request Last Maps Plugin [CS 1.6]
 
Here's the changes in log:

Code:

L 04/09/2023 - 17:58:48: -------- Mapchange to de_dust2 --------
L 04/09/2023 - 18:00:05: -------- Mapchange to de_test2 --------  //added by me to test
L 04/09/2023 - 19:31:37: -------- Mapchange to aa_dima2 --------
L 04/09/2023 - 19:47:39: -------- Mapchange to de_dust2 --------
L 04/09/2023 - 21:02:03: -------- Mapchange to de_korfez --------
L 04/09/2023 - 21:36:35: -------- Mapchange to css_cache --------

with style 1:

Code:

[AMXX] Last 10 Maps:

with style 0:
Code:

[AMXX] Last 10 Maps: 
1) 04/09/2023 21:36 
2) 04/09/2023 21:36 
3) 04/09/2023 21:36 
4) 04/09/2023 21:36 
5) 04/09/2023 21:36 
6) 04/09/2023 21:36 
7) 04/09/2023 21:36 
8) 04/09/2023 21:36 
9) 04/09/2023 21:36 
10) 04/09/2023 21:36


Napoleon_be 04-09-2023 23:06

Re: Request Last Maps Plugin [CS 1.6]
 
I have no time to do this, but to help BARRY. or anyone else out:

PHP Code:

register_message(SVC_INTERMISSION"OnIntermission"

Catch current map, nextmap and current time in there and log it to a file, it's honestly no rocket science. Just do some research.

WhiteFang1319 04-10-2023 03:42

Re: Request Last Maps Plugin [CS 1.6]
 
I appreciate the help from both of you. I found this plugin https://forums.alliedmods.net/showpo...38&postcount=2 by Exolent so I think I'll be using it


All times are GMT -4. The time now is 10:37.

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