AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need name of function likes register_clcmd (https://forums.alliedmods.net/showthread.php?t=57473)

kacperz1 07-05-2007 10:09

Need name of function likes register_clcmd
 
I was wondering if you could tell me what the function name is likes register_clcmd but you must write it not in console but in game (chat (default y key).

Sylwester 07-05-2007 10:22

Re: Need name of function likes register_clcmd
 
PHP Code:

public plugin_init(){

    ...
    
register_clcmd"say""check_say")
    
register_clcmd"say_team""check_say")
}

public 
check_say(id){
    new 
arg[32]
    
read_argsarg31 )

    if (
equali(arg,"^"/your_command^""){ // replace your_command with whatever you want
        
my_func(id)
    }
}

public 
my_func(id){
    
//this function will be executed if player with id write /your_command in chat (say or say_team)




All times are GMT -4. The time now is 21:25.

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