Raised This Month: $51 Target: $400
 12% 

Ban for retry/reconnect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 12-19-2009 , 06:31   Ban for retry/reconnect
Reply With Quote #1

Please create plugin:

Player "a" say retry in console he will be banned for time (set to cvar)


Sorry for my bad english!
dark_style is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-19-2009 , 07:30   Re: Ban for retry/reconnect
Reply With Quote #2

PHP Code:
#include <amxmodx>
 
#define NO_RECONNECT_TIME 30.0
 
new Trie:g_SteamID;
 
public 
plugin_init()
{
        
register_plugin("No Reconnect""1.2 Fix""hleV");
 
        
g_SteamID TrieCreate();
}
 
public 
plugin_end()
        
TrieDestroy(g_SteamID);
 
public 
client_authorized(Client)
{
        static 
SteamID[32];
        
get_user_authid(ClientSteamID31);
 
        if (!
TrieKeyExists(g_SteamIDSteamID))
                return;
 
        static 
Float:TimeReason[64];
        
TrieGetCell(g_SteamIDSteamIDTime);
 
        
Time NO_RECONNECT_TIME - (get_gametime() - Time);
        
formatex(Reason63"Wait %d seconds before connecting again!"floatround(Time));
 
        
Disconnect(ClientReason);
        
set_task(NO_RECONNECT_TIME"RemoveSteamID"_SteamID32);
}
 
public 
client_disconnect(Client)
{
        static 
SteamID[32];
        
get_user_authid(ClientSteamID31);
        
TrieSetCell(g_SteamIDSteamIDget_gametime());
}
 
public 
RemoveSteamID(SteamID[32])
        
TrieDeleteKey(g_SteamIDSteamID);
 
stock Disconnect(const Client, const Reason[] = "")
{
        
message_begin(MSG_ONESVC_DISCONNECT_Client);
        
write_string(Reason);
        
message_end();

__________________

Last edited by hleV; 12-19-2009 at 08:10. Reason: Fixed.
hleV is offline
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 12-19-2009 , 07:44   Re: Ban for retry/reconnect
Reply With Quote #3

Verry thanks.

+k

Last edited by dark_style; 12-19-2009 at 07:52.
dark_style is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-19-2009 , 08:07   Re: Ban for retry/reconnect
Reply With Quote #4

Fixed the above version.
__________________
hleV is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 01-11-2010 , 20:31   Re: Ban for retry/reconnect
Reply With Quote #5

cvar turn on/off
ex: no_reconnect 1 on | 0 off
BackStats is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 01-13-2010 , 10:56   Re: Ban for retry/reconnect
Reply With Quote #6

Quote:
Originally Posted by BackStats View Post
cvar turn on/off
ex: no_reconnect 1 on | 0 off
Here. Use amx_noreconnecttime <seconds>. Set CVAR to 0 in order to turn plugin off.
PHP Code:
#include <amxmodx>
 
new Trie:g_SteamIDg_NoReconnectTime;
 
public 
plugin_init()
{
        
register_plugin("No Reconnect""1.3""hleV");
 
        
g_NoReconnectTime register_cvar("amx_noreconnecttime""30.0");
        
g_SteamID TrieCreate();
}
 
public 
plugin_end()
        
TrieDestroy(g_SteamID);
 
public 
client_authorized(Client)
{
        new 
Float:NoReconnectTime get_pcvar_float(g_NoReconnectTime);
 
        if (!
NoReconnectTime)
                return;
 
        new 
SteamID[32];
        
get_user_authid(ClientSteamID31);
 
        if (!
TrieKeyExists(g_SteamIDSteamID))
                return;
 
        new 
Float:TimeReason[64];
        
TrieGetCell(g_SteamIDSteamIDTime);
 
        
Time NoReconnectTime - (get_gametime() - Time);
        
formatex(Reason63"Wait %d seconds before connecting again!"floatround(Time));
 
        
Disconnect(ClientReason);
        
set_task(NoReconnectTime"RemoveSteamID"_SteamID32);
}
 
public 
client_disconnect(Client)
{
        new 
SteamID[32];
        
get_user_authid(ClientSteamID31);
        
TrieSetCell(g_SteamIDSteamIDget_gametime());
}
 
public 
RemoveSteamID(SteamID[32])
        
TrieDeleteKey(g_SteamIDSteamID);
 
stock Disconnect(const Client, const Reason[] = "")
{
        
message_begin(MSG_ONESVC_DISCONNECT_Client);
        
write_string(Reason);
        
message_end();

__________________
hleV is offline
ditmesteam
Senior Member
Join Date: Oct 2009
Old 01-14-2010 , 13:46   Re: Ban for retry/reconnect
Reply With Quote #7

Can you modify: if reconnect, drop all guns, his money will be 800$! Thanks!
ditmesteam is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 02-03-2010 , 08:23   Re: Ban for retry/reconnect
Reply With Quote #8

good plugin, cvar turn on/off?
BackStats is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 02-03-2010 , 10:33   Re: Ban for retry/reconnect
Reply With Quote #9

Quote:
Originally Posted by BackStats View Post
good plugin, cvar turn on/off?
Can you read the whole topic again?
KadiR is offline
Reply



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 14:04.


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