Raised This Month: $ Target: $400
 0% 

[HELP] anti retry bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 09-25-2011 , 17:43   [HELP] anti retry bug
Reply With Quote #1

Hello, I have a plugin that when someone in retry, you have to wait 20 seconds to reconnect again. But when I wait 20 seconds and try to reconnect, for example looks like this: -1 -2 -3 -4 -5 and so forward! Anyone know any solution for this?

thanks

PHP Code:
#include <amxmodx>

new Trie:g_SteamIDg_NoReconnectTime;

public 
plugin_init()
{
register_plugin("PUG NoRetry""1.0.2""Joao Krames");

g_NoReconnectTime register_cvar("amx_noretry""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"Sem retry. Aguarde %d para reconectar-se."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();

__________________
kramesa is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-26-2011 , 01:31   Re: [HELP] anti retry bug
Reply With Quote #2

It's better to prevent those users from spawning.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 09-26-2011 , 05:34   Re: [HELP] anti retry bug
Reply With Quote #3

That above totally looks like one of my codes with changed author. Anyway I found this:
http://forums.alliedmods.net/showpos...85&postcount=2

EDIT: And if you decide to go with ConnorMcLeod's suggestion:
http://forums.alliedmods.net/showpos...61&postcount=9
__________________

Last edited by hleV; 09-26-2011 at 08:04.
hleV 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 19:38.


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