couldnt select a team when first joining and showscores closes when player spawns
PHP Code:
#include <amxmodx>
const MAX_PLAYERS = 32
new joined[MAX_PLAYERS + 1]
public plugin_init()
{
register_logevent("JoinTeam", 3, "1=joined team")
set_task(1.0, "showscores", .flags="b")
}
public client_authorized(id)
joined[id] = false
public client_disconnected(id)
joined[id] = false
public JoinTeam()
{
new loguser[80], name[32]
read_logargv(0, loguser, 79)
parse_loguser(loguser, name, 31)
new id = get_user_index(name)
if(is_user_bot(id) && is_user_hltv(id))
return
new temp[2]
read_logargv(2, temp, 1)
switch(temp[0])
{
case 'T', 'C', 'S' : joined[id] = true
default: joined[id] = false
}
}
public showscores()
{
new players[MAX_PLAYERS], num, id
get_players(players, num, "bch")
for (new i = 0; i < num; i++)
{
id = players[i]
if (joined[id])
client_cmd(id, "+showscores")
}
}
__________________