Raised This Month: $ Target: $400
 0% 

Overflowing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 06-18-2012 , 13:36   Overflowing
Reply With Quote #1

PHP Code:
#include <amxmodx>
new Trie:Cvars
#define AMOUNT 152

new const g_komandos[AMOUNT][] = 
{
"kzh_bhop",
//and 151 so that i don't want to show.... w/o value
}

public 
plugin_cfg() {
    
Cvars TrieCreate()
    for (new 
0AMOUNTi++) 
    
TrieSetCell(Cvarsg_komandos[i], i+1)    
}

public 
client_connect(id) { 
    if (
is_user_connected(id) && !is_user_bot(id) && !is_user_hltv(id)) {
    for (new 
0AMOUNTi++)
    
query_client_cvar(idg_komandos[i],"Cvar_Result")
    }
}
public 
client_disconnect(id) {
    
remove_task(id)
}
public 
Cvar_Result(id, const cvar[], const value[]) { 
    static 
value_check[6]
    
    
TrieGetString(Cvarscvarvalue_checkcharsmax(value_check))
    
    if(!
equal(valuevalue_check))
    
veiksmas(id)
}
public 
veiksmas(id) {
    
server_cmd("kick #%d ^"blabla^""get_user_userid(id))
    
//server_cmd("amx_ban 40320 #%d ^"blabla^"", get_user_userid(id)) 
first of all i getting overflow, couse theres much g_komandos = cvars, second i want specify reason to every cvar,thanks

the error in client console
server logs: none, tryed to debug plugin: none

Quote:
myserverip:myserverport:Outgoing message overflow
kileedyg is offline
Send a message via Skype™ to kileedyg
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 06-18-2012 , 15:29   Re: Overflowing
Reply With Quote #2

Try to use a delay in client_connect or use query_client_cvar in Ham_Spawn post.
dFF is offline
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 06-19-2012 , 10:14   Re: Overflowing
Reply With Quote #3

Quote:
Originally Posted by dFF View Post
Try to use a delay in client_connect or use query_client_cvar in Ham_Spawn post.

more than 4x cvars i can't check, even cycled it ,also used as you said a delay and ham spawn still..
kileedyg is offline
Send a message via Skype™ to kileedyg
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-19-2012 , 12:41   Re: Overflowing
Reply With Quote #4

It's because you are querying them all at once. Do one at a time.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 06-19-2012 , 13:41   Re: Overflowing
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
It's because you are querying them all at once. Do one at a time.
show me example, please...
kileedyg is offline
Send a message via Skype™ to kileedyg
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-19-2012 , 16:09   Re: Overflowing
Reply With Quote #6

Again, the method is not efficient, but if you still want to use i you can use my old plugin.
Add all cvars in a file, pay attention to not put 2 cvars twice.

Quote:
Originally Posted by amxmodx/configs/hacks_prefixes.ini
"kzh_bhop"
"zhy_bhop"
"kyk_bhop"
"kxk_bhop"
"xhz_bhop"
"yhz_bhop"
"v0n_bhop"
"xyz_bhop"
"kid_bhop"
"fpt_bhop"
"fuh_bhop"
"omg_bhop"
"voo_bhop"
"xHack_bhop"
"xKz_bhop"
"xkz_bhop"
"001_bhop"
"002_bhop"
"Trk_bhop"
"m3c_bhop"
"m4c_bhop"
"zhyk_bhop"
"xcfgbhop"
"zhe_bhop"
"^^_^^<bhop"
"n1k<bhop"
"nkz_bhop"
"nik_bhop"
"str_bhop"
"vip_bhop"
"xhack_bhop"
etc...


PHP Code:
#include <amxmodx>

#define VERSION "0.0.1"
#define PLUGIN "KZH Checker"

enum _:playerTasks ( += 33 )
{
    
CVAR_CHECKER,
    
}

new 
g_szFirstCvar[32]
new 
Trie:g_tNextCvar
new g_pCvarBanTime

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
g_pCvarBanTime register_cvar("kz_hack_bantime""0")

    new 
szCvarsFile[128], szOldCvar[32], szNewCvar[32]
    
get_localinfo("amxx_configsdir"szCvarsFilecharsmax(szCvarsFile))
    
add(szCvarsFilecharsmax(szCvarsFile), "/hacks_prefixes.ini")
    new 
fp fopen(szCvarsFile"rt")
    if( 
fp && file_size(szCvarsFile1) >= )
    {
        
g_tNextCvar TrieCreate()
        while( !
feof(fp) )
        {
            
fgets(fpszNewCvarcharsmax(szNewCvar))
            
trimszNewCvar )
            
remove_quotesszNewCvar )
            if( 
szOldCvar[0] && TrieKeyExists(g_tNextCvarszOldCvar) )
            {
                
TrieSetString(g_tNextCvarszOldCvarszNewCvar)
            }
            else
            {
                
copy(g_szFirstCvarcharsmax(g_szFirstCvar), szNewCvar)
            }
            
copy(szOldCvarcharsmax(szOldCvar), szNewCvar)
        }
        
TrieSetString(g_tNextCvarszOldCvarg_szFirstCvar)
    }
    if( 
fp )
    {
        
fclosefp )
    }
}

public 
client_putinserverid )
{
    
remove_task(id CVAR_CHECKER)
    if( !
is_user_bot(id) && !is_user_hltv(id) )
    {
        if( 
g_tNextCvar )
        {
            
set_task(0.1"Task_CheckCheatCvar"id CVAR_CHECKER)
        }
    }
}

public 
Task_CheckCheatCvar(id)
{
    
id %= 33
    
if( is_user_connected(id) )
    {
        
query_client_cvar(idg_szFirstCvar"ClientCvarResult")
    }
}

public 
ClientCvarResult(id, const szCvar[], const szValue[])
{
    if( 
is_user_connected(id) )
    {
        if( 
szValue[0] != 'B' )
        {
            new 
szName[32], szAuthid[32], szReason[14]
            if( 
equal(szCvar"kzh"3) )
            {
                
szReason "KZHack"
            
}
            else
            {
                
szReason "KZHack Custom"
            
}

            
get_user_name(idszNamecharsmax(szName))
            
get_user_authid(idszAuthidcharsmax(szAuthid))

            
server_cmd("amx_ban ^"%s^" %d ^"%s^""szAuthidget_pcvar_num(g_pCvarBanTime), szReason)
        }
        static 
szNextCvar[9]
        if( 
TrieGetString(g_tNextCvarszCvarszNextCvarcharsmax(szNextCvar)) )
        {
            
query_client_cvar(idszNextCvar"ClientCvarResult")
        }
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
kileedyg
BANNED
Join Date: Dec 2008
Location: Lithuania
Old 06-20-2012 , 05:46   Re: Overflowing
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
Again, the method is not efficient, but if you still want to use i you can use my old plugin.
Add all cvars in a file, pay attention to not put 2 cvars twice.



etc...


PHP Code:
#include <amxmodx>

#define VERSION "0.0.1"
#define PLUGIN "KZH Checker"

enum _:playerTasks ( += 33 )
{
    
CVAR_CHECKER,
    
}

new 
g_szFirstCvar[32]
new 
Trie:g_tNextCvar
new g_pCvarBanTime

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
g_pCvarBanTime register_cvar("kz_hack_bantime""0")

    new 
szCvarsFile[128], szOldCvar[32], szNewCvar[32]
    
get_localinfo("amxx_configsdir"szCvarsFilecharsmax(szCvarsFile))
    
add(szCvarsFilecharsmax(szCvarsFile), "/hacks_prefixes.ini")
    new 
fp fopen(szCvarsFile"rt")
    if( 
fp && file_size(szCvarsFile1) >= )
    {
        
g_tNextCvar TrieCreate()
        while( !
feof(fp) )
        {
            
fgets(fpszNewCvarcharsmax(szNewCvar))
            
trimszNewCvar )
            
remove_quotesszNewCvar )
            if( 
szOldCvar[0] && TrieKeyExists(g_tNextCvarszOldCvar) )
            {
                
TrieSetString(g_tNextCvarszOldCvarszNewCvar)
            }
            else
            {
                
copy(g_szFirstCvarcharsmax(g_szFirstCvar), szNewCvar)
            }
            
copy(szOldCvarcharsmax(szOldCvar), szNewCvar)
        }
        
TrieSetString(g_tNextCvarszOldCvarg_szFirstCvar)
    }
    if( 
fp )
    {
        
fclosefp )
    }
}

public 
client_putinserverid )
{
    
remove_task(id CVAR_CHECKER)
    if( !
is_user_bot(id) && !is_user_hltv(id) )
    {
        if( 
g_tNextCvar )
        {
            
set_task(0.1"Task_CheckCheatCvar"id CVAR_CHECKER)
        }
    }
}

public 
Task_CheckCheatCvar(id)
{
    
id %= 33
    
if( is_user_connected(id) )
    {
        
query_client_cvar(idg_szFirstCvar"ClientCvarResult")
    }
}

public 
ClientCvarResult(id, const szCvar[], const szValue[])
{
    if( 
is_user_connected(id) )
    {
        if( 
szValue[0] != 'B' )
        {
            new 
szName[32], szAuthid[32], szReason[14]
            if( 
equal(szCvar"kzh"3) )
            {
                
szReason "KZHack"
            
}
            else
            {
                
szReason "KZHack Custom"
            
}

            
get_user_name(idszNamecharsmax(szName))
            
get_user_authid(idszAuthidcharsmax(szAuthid))

            
server_cmd("amx_ban ^"%s^" %d ^"%s^""szAuthidget_pcvar_num(g_pCvarBanTime), szReason)
        }
        static 
szNextCvar[9]
        if( 
TrieGetString(g_tNextCvarszCvarszNextCvarcharsmax(szNextCvar)) )
        {
            
query_client_cvar(idszNextCvar"ClientCvarResult")
        }
    }


fabulous mr connor, i will use this! also whats the efficient method?
kileedyg is offline
Send a message via Skype™ to kileedyg
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 06:11.


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