View Single Post
Markiez
Junior Member
Join Date: Mar 2018
Location: somewhere over the rainbow
Old 05-06-2018 , 14:01   Re: Auto 1 day ban to Sourcebans on leaving server
Reply With Quote #3

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");
}

Last edited by Markiez; 05-06-2018 at 14:02. Reason: i included cstrike, didn't even use it lol ^^
Markiez is offline