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");
}
}
}
}