Raised This Month: $ Target: $400
 0% 

BothTeams by cvar


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Ex3cuTioN
Member
Join Date: May 2010
Old 08-07-2010 , 14:13   BothTeams by cvar
Reply With Quote #1

So how can i do to make both teams use the command with the cvar.It works if the cvar is 1 for t and 2 for ct, but not work if it's 3.

PHP Code:
#include <amxmodx>

new cvar;

public 
plugin_init() {
    
cvar register_cvar("amx_show_team","3");
    
/*
        1 - only t
        2 - only ct
        3 - both
    */
    
register_clcmd("say /message","cmdShow");
}

public 
cmdShow(id) {
    new 
team;
    if(
get_pcvar_num(cvar)) {
        
team 1;
    }
    else if(
get_pcvar_num(cvar) == 2) {
        
team 2;
    }
    else if(
get_pcvar_num(cvar) == 3) {
        
team 0;
    }
        
    if(
get_user_team(id) == team) {
        
client_print(id,print_chat,"It worked");
    }
    else {
        switch(
get_pcvar_num(cvar)) {
            case 
1:
            {
                
client_print(id,print_chat,"You must be T");
            }
            case 
2:
            {
                
client_print(id,print_chat,"You must be CT");
            }
        }
    }

Ex3cuTioN is offline
 



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 00:10.


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