Raised This Month: $ Target: $400
 0% 

[ SOLVED ] Say cmds & Args


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-24-2009 , 06:24   [ SOLVED ] Say cmds & Args
Reply With Quote #1

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;

__________________

Last edited by xPaw; 06-24-2009 at 06:40.
xPaw is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-24-2009 , 06:40   Re: [ SOLVED ] Say cmds & Args
Reply With Quote #2

Solved by hooking 'say' and getting args there, but still this is strange...
__________________
xPaw 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 15:29.


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