Raised This Month: $32 Target: $400
 8% 

Mass kick


  
 
 
Thread Tools Display Modes
GoRiLliAz
Senior Member
Join Date: May 2013
Old 08-27-2013 , 08:57   Re: Mass kick
#21

Bonjour,

Connor a remis a jours un plugins qui existé déjà, je suis entrain de le tester sur mon serveur pour le moment cela règles bien le problème. Quand Connor décidera que le plugin fonctionne bien il le mettra en ligne dans le post de l'auteur original.

Merci a vous.
GoRiLliAz is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-27-2013 , 11:59   Re: Mass kick
#22

De quel plugin tu parles ?
__________________
Arkshine is offline
GoRiLliAz
Senior Member
Join Date: May 2013
Old 08-27-2013 , 12:22   Re: Mass kick
#23

Bonjour,

https://forums.alliedmods.net/showpo...8&postcount=41

Celui-ci, cette version ne marché pas avant qu'il la modifie. La version de connor n'est pas encore présente sur ce topic.Mais elle marche plutôt bien. Aucun mass kick pour le moment, enfin 1 seul mais c'est le plugins qui a kick tous le monde on a pas trouvé la raison


[EDIT] Le plugin:

Code:
#include <amxmodx>
#include <amxmisc>

#include <fakemeta>

new const Plugin[] = "Bad Clients Handler"
new const Author[] = "joaquimandrade/Connor"
new const Version[]	= "1.04"

new Float:LastCommandReceivedTime[33]
new IsConnected[33]

new MaxPlayers 

new Float:ThinkDelay = 0.1

new CvarTimeout
new CvarTimeoutRoundStart

public plugin_init()
{
	register_plugin(Plugin, Version, Author)
	register_forward(FM_CmdStart, "cmdStart")
	
	register_event("HLTV", "newRound", "a", "1=0", "2=0")

	set_task(ThinkDelay, "handlerThink", .flags="b")
	
	CvarTimeout = register_cvar("badclients_timeout", "5.0")
	CvarTimeoutRoundStart = register_cvar("badclients_timeout_round", "3.0")
	MaxPlayers = get_maxplayers()
}

public newRound()
{
	checkBadClients(get_pcvar_float(CvarTimeoutRoundStart))
}

checkBadClients(Float:timeout)
{
	static Float:gametime
	gametime = get_gametime()
	for(new i=1; i<= MaxPlayers; i++)
	{
		if( IsConnected[i] )
		{
			if( (gametime - LastCommandReceivedTime[i]) >= timeout)
			{	
				forceDisconnect(i)
			}
		}	
	}
}

public handlerThink(id)
{
	checkBadClients(get_pcvar_float(CvarTimeout))
}

forceDisconnect(id)
{
	new name[32], steamID[21]
	
	get_user_name(id, name, charsmax(name))
	get_user_authid(id, steamID, charsmax(steamID))

	log_to_file("badClientsHandler.txt", "Forcing disconnect of client ^"%s<%s>", name, steamID)

	client_cmd(id, "reconnect") // if this is false/positive, try to reconnect player

	server_cmd("kick #%d ^"Seems you are timeout, preventing multiple overflows/kicks^"", get_user_userid(id))
	server_exec()
}

public client_putinserver(id)
{
	IsConnected[id] = !is_user_bot(id) && !is_user_hltv(id)
	LastCommandReceivedTime[id] = get_gametime() + 1.0
}

public client_disconnect(id)
{
	if(IsConnected[id])
		IsConnected[id] = false
}

public cmdStart(id,uc_handle,random_seed)
{
	LastCommandReceivedTime[id] = get_gametime()
}

Last edited by Arkshine; 05-10-2015 at 12:21.
GoRiLliAz is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:29.


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