Raised This Month: $32 Target: $400
 8% 

[PLUGIN] Auto Pass Remover [Need, CVAR Addition]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 11-12-2016 , 06:57   [PLUGIN] Auto Pass Remover [Need, CVAR Addition]
Reply With Quote #1

Can Anyone edit this GHW_Auto_Pass_Remover.
Though It's Fine, But I Want An Additonal Cvar In It ..!!
apr_checkplayers "" [Check Number Of Minimum Players, If Less Or = To That, Server Should Remove Pass, Instead As It Is Now (Current Version), Just Specific To Zero]

PHP Code:
/*
*   _______     _      _  __          __
*  | _____/    | |    | |     __   / /
*  | |         | |    | |  | | /   | |
*  | |         | |____| |  | |/ __ | |
*  | |   ___   | ______ |  |   /     |
*  | |  |_  |  | |    | |  |  /      |
*  | |    | |  | |    | |  | |      | |
*  | |____| |  | |    | |  | |      | |
*  |_______/   |_|    |_|  _/      _/
*
*
*
*  Last Edited: 12-30-07
*
*  ============
*   Changelog:
*  ============
*
*  v2.0
*    -Added ML
*    -Optimized Code
*
*  v1.2
*    -Code Rewrite by GHW_Chronic
*
*  v1.1
*    -Initial Port by GHW_Chronic
*
*  v1.0
*    -Initial Release by March
*
*/

#define VERSION    "2.0"

#include <amxmodx>
#include <amxmisc>

new numchecked

new check_pcvar
new enabled_pcvar
new password_pcvar

public plugin_init()
{
    
register_plugin("Auto Password Remover",VERSION,"GHW_Chronic")
    new 
delay_pcvar register_cvar("apr_checkdelay","20.0")
    
check_pcvar register_cvar("apr_checktimes","3")
    
enabled_pcvar register_cvar("apr_enabled","1")

    
password_pcvar get_cvar_pointer("sv_password")

    
numchecked 0

    
if(get_pcvar_float(delay_pcvar)<=1.0)
        
set_pcvar_float(delay_pcvar,1.0)

    
set_task(get_pcvar_float(delay_pcvar),"check_server",0,"",0,"b")

    
register_dictionary("GHW_auto_password_remover.txt")
}

public 
check_server()
{
    if(
get_pcvar_num(enabled_pcvar))
    {
        new 
curpass[32]
        
get_pcvar_string(password_pcvar,curpass,31)
    
        if(
strlen(curpass)>&& !equali(curpass,"none"))
        {
            new 
players[32], num
            get_players
(players,num,"ch")
            if(
num==0)
            {
                
numchecked++
                if(
numchecked>=get_pcvar_num(check_pcvar))
                {
                    
log_amx("%L",0,"MSG_REMOVE")

                    
set_cvar_string("sv_password","none")

                    
numchecked=0
                
}
            }
            else
                
numchecked 0
        
}
        else
            
numchecked 0
    
}
    else
        
numchecked 0


Last edited by Alber9091; 11-12-2016 at 21:37.
Alber9091 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 23:23.


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