AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] anti retry bug (https://forums.alliedmods.net/showthread.php?t=168221)

kramesa 09-25-2011 17:43

[HELP] anti retry bug
 
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();



ConnorMcLeod 09-26-2011 01:31

Re: [HELP] anti retry bug
 
It's better to prevent those users from spawning.

hleV 09-26-2011 05:34

Re: [HELP] anti retry bug
 
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


All times are GMT -4. The time now is 19:38.

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