AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   GetCurrentMap - does not work correctly (https://forums.alliedmods.net/showthread.php?t=338639)

echocage 07-18-2022 09:55

GetCurrentMap - does not work correctly
 
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 07-18-2022 10:09

Re: GetCurrentMap - does not work correctly
 
Oops, it seems I did not name the topic correctly, admins - please rename to "OnMapStart- does not work correctly" :3

echocage 07-18-2022 16:20

Re: GetCurrentMap - does not work correctly
 
bump

Cruze 07-19-2022 09:40

Re: GetCurrentMap - does not work correctly
 
sv_hibernate_when_empty 0

echocage 07-19-2022 18:18

Re: GetCurrentMap - does not work correctly
 
Alas, it didn't work for me :(
Quote:

Originally Posted by Cruze (Post 2784166)
sv_hibernate_when_empty 0


Bacardi 07-23-2022 11:12

Re: GetCurrentMap - does not work correctly
 
[CSGO] Stop restart match when empty

echocage 07-23-2022 17:17

Re: GetCurrentMap - does not work correctly
 
Quote:

Originally Posted by Bacardi (Post 2784514)

Unfortunately this didn't work for me either


All times are GMT -4. The time now is 13:24.

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