AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cmd_target / find_player (https://forums.alliedmods.net/showthread.php?t=153296)

JocAnis 03-21-2011 11:29

cmd_target / find_player
 
need help with find_player or cmd_target...i m trying to make code which will work like: say /stop Nick => stop command execute on Nick, here is my try:

PHP Code:

register_clcmd"say /stop""stop" )

public 
stopid )
{
    new 
arg132 ], name32 ]
    
read_argv1arg131 )
    
    new 
player find_player"bl" )//also tryed with: cmd_target( id, arg1, 31 ) and cmd_target( id, arg1, 0 ), none works
    
    
if( player )
    {
        
get_user_nameplayername31 )
        
kuldaunplayer ] = false
        ColorChat
0TEAM_COLOR"^4[Mini-Ban]^3 %s^1 je ipak ubedio admine da ne koristi zabranjene komande." )//this not metter
    
}
    else
    {
        
ColorChat0TEAM_COLOR"No player founds" )
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED


thanks.

ConnorMcLeod 03-21-2011 13:19

Re: cmd_target / find_player
 
If you register the command, the callback will never be triggered if you say something more than /stop.
You have to register only "say" command and then to check args (read_args, remove_quote, parse)


All times are GMT -4. The time now is 14:32.

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