PHP Code:
#include <sourcemod>
#include <sdktools>
public void OnClientDisconnect_Post(client)
{
DoThis(client);
}
public void DoThis(client) {
char mapname[128];
GetCurrentMap(mapname, sizeof(mapname));
if (strncmp(mapname, "dm_surrender_h", 14) == 0)
{
if (IsFakeClient(client))
{
Plugin_Stop;
}
else
{
if (GetClientCount() == 1) {
//console commands I had here that are irrelevant to the issue
Plugin_Continue;
}
if (GetClientCount() >= 2) {
//console commands I had here that are irrelevant to the issue
Plugin_Continue;
}
}
}
}
I also tried this:
PHP Code:
#include <sourcemod>
#include <sdktools>
public void OnPluginStart()
{
RegConsoleCmd("disconnect", Command_Disconnect);
}
public Action Command_Disconnect(client, args)
{
DoThis(client);
}
public void DoThis(client) {
char mapname[128];
GetCurrentMap(mapname, sizeof(mapname));
if (strncmp(mapname, "dm_surrender_h", 14) == 0)
{
if (IsFakeClient(client))
{
Plugin_Stop;
}
else
{
if (GetClientCount() == 1) {
//console commands I had here that are irrelevant to the issue
Plugin_Continue;
}
if (GetClientCount() >= 2) {
//console commands I had here that are irrelevant to the issue
Plugin_Continue;
}
}
}
}
Does anyone know why these aren't working?
OnClientDisconnect works, however it will count the player that disconnected too, so I don't like that.