Raised This Month: $51 Target: $400
 12% 

Solved Request Last Maps Plugin [CS 1.6]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 04-07-2023 , 07:22   Request Last Maps Plugin [CS 1.6]
Reply With Quote #1

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!

Last edited by WhiteFang1319; 04-10-2023 at 03:43.
WhiteFang1319 is offline
BARRY.
Junior Member
Join Date: Aug 2013
Old 04-07-2023 , 22:53   Re: Request Last Maps Plugin [CS 1.6]
Reply With Quote #2

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.

Last edited by BARRY.; 04-09-2023 at 05:05.
BARRY. is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 04-08-2023 , 12:11   Re: Request Last Maps Plugin [CS 1.6]
Reply With Quote #3

Quote:
Originally Posted by BARRY. View Post
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
WhiteFang1319 is offline
BARRY.
Junior Member
Join Date: Aug 2013
Old 04-09-2023 , 05:01   Re: Request Last Maps Plugin [CS 1.6]
Reply With Quote #4

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:065: -------- Mapchange to de_inferno --------
L 04/07/2023 - 222:09: -------- Mapchange to de_mirage --------
L 04/07/2023 - 22:492: -------- Mapchange to de_inferno --------
BARRY. is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 04-09-2023 , 08:33   Re: Request Last Maps Plugin [CS 1.6]
Reply With Quote #5

Quote:
Originally Posted by BARRY. View Post
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.

Last edited by WhiteFang1319; 04-09-2023 at 08:34.
WhiteFang1319 is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 04-09-2023 , 12:14   Re: Request Last Maps Plugin [CS 1.6]
Reply With Quote #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
WhiteFang1319 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-09-2023 , 23:06   Re: Request Last Maps Plugin [CS 1.6]
Reply With Quote #7

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.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 04-10-2023 , 03:42   Re: Request Last Maps Plugin [CS 1.6]
Reply With Quote #8

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
WhiteFang1319 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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