amxx took my API virginity

, not so much now but the possibilities of what I'll be able to do with my favourite game!
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Basics"
#define VERSION "1.0"
#define AUTHOR "Hihiyoyo"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /rules", "rules")
register_clcmd("jointeam", "block_jointeam")
}
public rules(id) {
new message[1000]
read_argv(1, message, 1000)
client_print(id, print_chat, "%s : /rules", name)
new name[31]
get_user_name(id, name, 30)
client_print(id, print_chat, "%s The rules are..", name)
return PLUGIN_HANDLED
}
public block_jointeam(id) {
client_print(id, print_chat, "test")
client_print(id, print_chat, "team = %s", cs_get_user_team(id))
if (cs_get_user_team(id) != CS_TEAM_SPECTATOR &&
!cs_get_user_team(id) &&
cs_get_user_team(id) != CS_TEAM_UNASSIGNED) return PLUGIN_HANDLED
else {
new team[2]
read_argv(1, team, 1)
client_print(id, print_chat, "0 = %s", team[0])
if (team[0] == '1') cs_set_user_team(id, CS_TEAM_T)
else if (team[0] == '2') cs_set_user_team(id, CS_TEAM_CT)
else cs_set_user_team(id, CS_TEAM_SPECTATOR)
}
return PLUGIN_HANDLED
}
I did your suggestions and changed a few things like client_cmd which was just making endless loops :@
debug results:
test
team =
0 = 3
which tells me cs_get_user_team isn't returning anything at all, not what func wiki says, thank you so much wrecked
EDIT: Also, in jointeam use the argument of 1 to get the team #, as 0 is the actual jointeam command itself.
so team[0] = jointeam, team[1] = team, team[2] = null? my debug comes out fine with the team numbers though