AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cant go to ct team (https://forums.alliedmods.net/showthread.php?t=163720)

PsychoPach 08-02-2011 14:08

cant go to ct team
 
how make, then you choose team (CT or T) you can't go to ct, you can go only to T, but with password (/password) you automaticly moved to ct?

sorry for me bad english

Kreation 08-02-2011 15:03

Re: cant go to ct team
 
This sounds like it should be in Suggestions/Requests.

avril-lavigne 08-02-2011 15:06

Re: cant go to ct team
 
PHP Code:

public Message_ShowMenuiMsgIdiMsgDestid 

    new 
szText[20// #IG_VIP_Team_Select 
    // #Terrorist_Select 
    // #CT_Select 
    
get_msg_arg_string(4szTextcharsmax(szText)) 

    if( 
contain(szText"Team_Select") != -
    { 
        new 
iKeys get_msg_arg_int(1
        new 
bool:bKeyChanged 
        
new szText[512], 
        
new szName[64
        
formatex(szTextcharsmax(szText), "\ySelect a team\w^n^n"

        if( 
get_pcvar_string(g_pCvarTerroNameszNamecharsmax(szName)) ) 
        { 
            
+= formatex(szText[n], charsmax(szText)-n"1. %s^n"szName
        } 
        else 
        { 
            
+= formatex(szText[n], charsmax(szText)-n"\d1. Not Available\w^n"
            
iKeys &= ~MENU_KEY_1 
            bKeyChanged 
true 
        


        if( 
get_pcvar_string(g_pCvarCtNameszNamecharsmax(szName)) ) 
        { 
            
+= formatex(szText[n], charsmax(szText)-n"2. %s^n"szName
        } 
        else 
        { 
            
+= formatex(szText[n], charsmax(szText)-n"\d2. Not Available\w^n"
            
iKeys &= ~MENU_KEY_2 
            bKeyChanged 
true 
        

====================================
      
somewhere here
       
        
if( iKeys MENU_KEY_1 
        { 
               
bKeyChanged true 
   MAKE 
NEW BOOLEAN HERE LIKE g_allowJoin[id] = true
            

        } 

        if( 
iKeys MENU_KEY_2 
        { 
            
set Boolean to false
 
and make additional check for password



avril-lavigne 08-02-2011 15:07

Re: cant go to ct team
 
Just take any KZ JUMP plugin . in most jump plugins you can go only T. and will be easy d to modify access with the password or admin flags

PsychoPach 08-02-2011 16:11

Re: cant go to ct team
 
Thanks avril-lavigne i will try it

hornet 08-03-2011 01:21

Re: cant go to ct team
 
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!" );



PsychoPach 08-03-2011 13:22

Re: cant go to ct team
 
thanks hornet


All times are GMT -4. The time now is 03:22.

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