Raised This Month: $ Target: $400
 0% 

cant go to ct team


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-03-2011 , 01:21   Re: cant go to ct team
Reply With Quote #6

A bit more of a simple approach:

PHP Code:
#include <amxmodx>

new g_pPassword;
new 
bool:g_bLoggedIn33 ];

public 
plugin_init() 
{
    
g_pPassword register_cvar"ct_password""your_password_here" );
    
    
register_concmd"login""cmdPassword"_"password <password here>" );
    
    
register_clcmd"chooseteam""cmdTeam");
    
register_clcmd"jointeam""cmdTeam");
}

public 
client_connectid )
{
    
g_bLoggedInid ] = false;
}

public 
cmdTeamid )
{
    new 
szTeam];
    
read_argv1szTeam);
    
    if( 
str_to_numszTeam ) == && !g_bLoggedInid ] )
    {
        
client_printidprint_center"CT is unavailable without the password" );
        
client_cmdid"chooseteam" );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}
    
public 
cmdPasswordid )
{      
    new 
szArg32 ], szPass32 ];
    
read_argv1szArgcharsmaxszArg ) );
    
get_pcvar_stringg_pPasswordszPasscharsmaxszPass ) );
    
    if( 
equalszArgszPass ) )
    {
        
g_bLoggedInid ] = true;
        
console_printid"Successfully logged in!" );
    }
    else 
console_printid"Login Failed! Incorrect password!" );

__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
 



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 03:22.


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