Raised This Month: $ Target: $400
 0% 

BothTeams by cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ex3cuTioN
Member
Join Date: May 2010
Old 08-08-2010 , 02:37   Re: BothTeams by cvar
Reply With Quote #1

PHP Code:
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
    } 

PHP Code:
new team get_pcvar_num(cvar); 
Thank you for that.

nikhilgupta345:I want that command to be user only for 1(T's) 2(CT's) 3(both team).The message is showed to "id" not to all players from his team.

EDIT:

I think i found the solution

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 get_pcvar_num(cvar);
    new 
team_c get_user_team(id);
    
    if(
team == 3) {
        
client_print(id,print_chat,"It worked for both teams");
    }
    else if(
team_c == team) {
        
client_print(id,print_chat,"It worked for 1 specified team");
    }
    
    if(
team_c !=team) {
        switch(
team) {
            case 
1:
            {
                if(
team_c == 1) {
                    return 
PLUGIN_HANDLED;
                }
                
client_print(id,print_chat,"You must be T");
            }
            case 
2:
            {
                if(
team_c == 2) {
                    return 
PLUGIN_HANDLED;
                }
                
client_print(id,print_chat,"You must be CT");
            }
        }
    }
    return 
PLUGIN_CONTINUE;

I'm testing now, i'll be back with reply.

EDIT2 : IT worked thank you ex3cution

Last edited by Ex3cuTioN; 08-08-2010 at 02:46.
Ex3cuTioN is offline
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