Raised This Month: $ Target: $400
 0% 

Registering cl_cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-23-2011 , 23:05   Re: Registering cl_cmd
Reply With Quote #1

What are you trying to turn on and off? Is it something in the same plugin or is it in another plugin controlled by a cvar or command? The answer to this question may change the answer to your question.

This is a simple example for doing this:

PHP Code:
// plugin_init
    
register_clcmd("say /example""cmdExample")

public 
cmdExample(id)
{
    if( 
cs_get_user_team(id) == CS_TEAM_CT // Only allow do something if player is CT.
    
{
        
// Change state of plugin or function being controlled
        
if( /* on */ }
        {
            
// turn off
        
}
        else
        {
            
// turn on
        
}
    }

If this doesn't work or you don't understand then you need to answer my above question and explain exactly what you are using it for.
__________________
fysiks is online now
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 23:33.


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