View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 05-06-2018 , 15:49   Re: Auto 1 day ban to Sourcebans on leaving server
Reply With Quote #4

Quote:
Originally Posted by Markiez View Post
Why not just?
Code:
#include <sourcemod>

#pragma semicolon 1

bool Ready;

public void OnPluginStart()
{
	HookEvent( "player_disconnect", Event_Disconnect, EventHookMode_Pre);
	RegConsoleCmd("sm_ready", Cmd_Ready);
}

public Action Cmd_Ready(int client, int args)
{
	Ready = true;
}

public Action Event_Disconnect(Event event, const char[] name, bool dbc)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if (Ready)
	{
		Ready = false;
		return;
	}
	
	BanClient(client, 1440, BANFLAG_AUTO, "some shit here");
}
That one means just one person has to !ready up, not everyone on the server...
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline