No armor or health showing, I tried with spawn(id) it does the same, think im missing something with ham respawn, help please
edit:
tried cs_set_user_armor and set_user_health after ExecuteHamB(Ham_CS_RoundRespawn, id) and putting a model for cs_set_user_team still the same problem, someone tell me how I sort this out :/..
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "Fair Teams"
#define VERSION "1.0"
#define AUTHOR "Len"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("jointeam", "block_jointeam")
}
public block_jointeam(id) {
new team[2]
read_argv(1, team, 1)
if (access(id, ADMIN_IMMUNITY)) {
if (team[0] == '1') cs_set_user_team(id, CS_TEAM_T)
if (team[0] == '2') cs_set_user_team(id, CS_TEAM_CT)
goto SPAWN_PLAYER
}
if (CS_TEAM_UNASSIGNED < cs_get_user_team(id) < CS_TEAM_SPECTATOR) return PLUGIN_HANDLED
if (team[0] == '3') {
cs_set_user_team(id,CS_TEAM_SPECTATOR)
return PLUGIN_HANDLED
}
new i, team_balance[3], max_players
team_balance[team[0]] = 1
max_players = get_maxplayers()
for (i = 1; i <= max_players; i++) {
if (cs_get_user_team(id) == CS_TEAM_T) team_balance[0]++
else if (cs_get_user_team(id) == CS_TEAM_T) team_balance[1]++
}
team_balance[2] = team_balance[0] - team_balance[1]
if ((team_balance[2] < -1) || (team_balance[2] > 1)) {
if (team_balance[1] > team_balance[1]) cs_set_user_team(id, CS_TEAM_T)
else if (team_balance[0] > team_balance[1]) cs_set_user_team(id, CS_TEAM_CT)
goto SPAWN_PLAYER
}
if ((team[0] == '1') && (cs_get_user_team(id) != CS_TEAM_T)) cs_set_user_team(id, CS_TEAM_T)
else if ((team[0] == '2') && (cs_get_user_team(id) != CS_TEAM_CT)) cs_set_user_team(id, CS_TEAM_CT)
SPAWN_PLAYER:
ExecuteHamB(Ham_CS_RoundRespawn, id)
return PLUGIN_HANDLED
}