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

GetCurrentMap - does not work correctly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
echocage
Member
Join Date: Oct 2021
Old 07-18-2022 , 09:55   GetCurrentMap - does not work correctly
Reply With Quote #1

Hello! I ran into a problem, I wrote a plugin for the statistics of the popularity of different cards on my servers. I noticed that when everyone leaves the server for at least 5 seconds, the console displays "-> Reservation cookie 0: reason reserved(yes), clients(no), reservationexpires(0.00)
"- after that, when someone enters this empty server, the game activates OnMapStart again - please tell me how I can get around this.

Snippet of my code:

HTML Code:
public OnMapStart() {
	decl String:query[255];
	
	char server_port[10];
	char server_ip[16];
	
	new Handle:cvar_port = FindConVar("hostport");
	GetConVarString(cvar_port, server_port, sizeof(server_port));
	CloseHandle(cvar_port);
	
	new Handle:cvar_ip = FindConVar("ip");
	GetConVarString(cvar_ip, server_ip, sizeof(server_ip));
	CloseHandle(cvar_ip);
	
	char currentMap[256];
	GetCurrentMap(currentMap, 256)
	    
	Format(query, sizeof(query), "INSERT INTO map_count(map, server, time) VALUES ('%s','%s:%s','%i')", currentMap, server_ip, server_port, GetTime());
	SQL_TQuery(g_SQL, SQL_DefCallback, query, 0);
}
Thank you
echocage is offline
echocage
Member
Join Date: Oct 2021
Old 07-18-2022 , 10:09   Re: GetCurrentMap - does not work correctly
Reply With Quote #2

Oops, it seems I did not name the topic correctly, admins - please rename to "OnMapStart- does not work correctly"
echocage is offline
echocage
Member
Join Date: Oct 2021
Old 07-18-2022 , 16:20   Re: GetCurrentMap - does not work correctly
Reply With Quote #3

bump
echocage is offline
Cruze
Veteran Member
Join Date: May 2017
Old 07-19-2022 , 09:40   Re: GetCurrentMap - does not work correctly
Reply With Quote #4

sv_hibernate_when_empty 0
__________________
Taking paid private requests! Contact me
Cruze is offline
echocage
Member
Join Date: Oct 2021
Old 07-19-2022 , 18:18   Re: GetCurrentMap - does not work correctly
Reply With Quote #5

Alas, it didn't work for me
Quote:
Originally Posted by Cruze View Post
sv_hibernate_when_empty 0

Last edited by echocage; 07-19-2022 at 18:19.
echocage is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 07-23-2022 , 11:12   Re: GetCurrentMap - does not work correctly
Reply With Quote #6

[CSGO] Stop restart match when empty
__________________
Do not Private Message @me
Bacardi is offline
echocage
Member
Join Date: Oct 2021
Old 07-23-2022 , 17:17   Re: GetCurrentMap - does not work correctly
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
Unfortunately this didn't work for me either
echocage 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 02:07.


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