View Single Post
mlibre
Senior Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-19-2023 , 12:50   Re: Anty retry for bh
Reply With Quote #5

PHP Code:
//#define RUN_CMD    //enable to run command X on spawn

#include <amxmodx>

#if defined RUN_CMD
#include <hamsandwich>

new is_user_retry[33]
#endif

#define PLUGIN "s!mple anti-retry"
#define VERSION "2.0b"
#define AUTHOR "mlibre"

new Trie:g_Id

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_Id TrieCreate()
    
    
#if defined RUN_CMD
    
RegisterHam(Ham_Spawn"player""Ham_SpawnPlayer_Post"1)
    
#endif
}

public 
plugin_end() TrieDestroy(g_Id)

public 
client_putinserver(id)
{
    if(
get_user_flags(id) & ADMIN_MENU || is_user_bot(id) || is_user_hltv(id))
        return
    
    static 
authid[32]; get_user_authid(idauthidcharsmax(authid))
    
    if( !
TrieKeyExists(g_Idauthid) )
    {
        
TrieSetCell(g_Idauthid1)
    }
    else {
        
#if !defined RUN_CMD
        
server_cmd("kick #%d ^"have you reconnected... wait for the map change!^""get_user_userid(id))
        
#else
        
is_user_retry[id] = 1
        
#endif
    
}
}

#if defined RUN_CMD
public Ham_SpawnPlayer_Post(const id
{
    if( !
is_user_alive(id) ) 
        return 
HAM_IGNORED
    
    
if(is_user_retry[id])
    {
        
server_cmd("amx_infect #%d"get_user_userid(id))
        
        
is_user_retry[id] = 0
    
}
    
    return 
HAM_IGNORED
}
#endif 
__________________

Last edited by mlibre; 04-25-2023 at 13:10. Reason: update
mlibre is offline