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