Raised This Month: $ Target: $400
 0% 

BothTeams by cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-07-2010 , 15:01   Re: BothTeams by cvar
Reply With Quote #1

I don't think that 0 is a team num. 1=t, 2=ct, 3=spec. Also, if the cvar is 2, and u do the first get_pcvar_num, it still returns true because 2 returns true, not only 1. Idk if this is exactly what you wanted but basically what this does is if someone types /message, and the cvar is set to one, it will say to all of the t's that they are t. If cvar is set to two, it will show all of the ct's that they are ct's. If it is 3, it will show everyone "it worked". Clarify if this isn't what u wanted.

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=get_pcvar_num(cvar)
    new players[32], player, num
    get_players(players, num)
    
    if(team==3){
        
        switch(team) {
            
        
        case 1:
    {
        for(new i;i<num;i++)
      {      player=players[i]
          new team3=get_user_team(player)
          if(team3==1)
               client_print(id,print_chat,"You must be T");
      }
    }
            
       case 2:
    
    {
        for(new i;i<num;i++)
      {      player=players[i]
          new team4=get_user_team(player)
          if(team4==2)
               client_print(id,print_chat,"You must be CT");
      }
    }
 
       
       
       
       case 3:
    {

        client_print(0, print_chat, "It worked!")
    }
    
} 
}
}

Last edited by nikhilgupta345; 08-07-2010 at 15:07.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 00:10.


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