AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ SOLVED ] Say cmds & Args (https://forums.alliedmods.net/showthread.php?t=95492)

xPaw 06-24-2009 06:24

[ SOLVED ] Say cmds & Args
 
I tryed to make command say .newadmin nick but if i enter it in chat nothing happens, if i enter though console it works fine... i can`t understand why this happens

PHP Code:

register_clcmd"say .newadmin",   "CmdNewAdmin"GH_ADMIN );

public 
CmdNewAdminidlevelcid ) {
    if( !
cmd_accessidlevelcid) )
        return 
PLUGIN_CONTINUE;
    
    new 
szArg32 ];
    
read_argv2szArgcharsmaxszArg ) );
    
    
client_print0print_chat"%s"szArg );
    
    new 
iPlayer GHFindPlayeridszArg );
    
    if( !
iPlayer )
        return 
PLUGIN_CONTINUE;
    
    if( !( 
get_user_flagsiPlayer ) & GH_ADMIN ) ) {
        
ColorChatidDontChange"%s^1 This player can`t be gather admin, because he doesn`t have premium!"g_szPrefix );
        
        return 
PLUGIN_CONTINUE;
    }
    
    
menu_displayiPlayerg_iMenu_NewAdmin);
    
    
g_iOldAdmin id;
    
    return 
PLUGIN_CONTINUE;
}

stock GHFindPlayerid, const szArg[ ] ) {
    new 
iPlayer find_player"bl"szArg );
    
    if( 
iPlayer ) {
        if( 
iPlayer != find_player"blj"szArg ) ) {
            
ColorChatidDontChange"%s^1 There are more clients matching to your argument."g_szPrefix );
            
            return 
0;
        }
    }
    else if( 
szArg] == '#' && szArg] ) {
        
iPlayer find_player"k"str_to_numszArg] ) );
    }
    
    if( !
iPlayer ) {
        
ColorChatidDontChange"%s^1 Client with that name or userid not found."g_szPrefix );
        
        return 
0;
    }
    if( 
is_user_botiPlayer ) ) {
        
ColorChatidDontChange"%s^1 That action can't be performed on bot."g_szPrefix );
        
        return 
0;
    }
    
    return 
iPlayer;



xPaw 06-24-2009 06:40

Re: [ SOLVED ] Say cmds & Args
 
Solved by hooking 'say' and getting args there, but still this is strange...


All times are GMT -4. The time now is 15:29.

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