|
Senior Member
|
02-12-2024
, 08:14
Re: [req] auto scoreboard on ded screen
|
#8
|
Quote:
Originally Posted by bigdaddy424
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") } }
|
The team pick aspect is irrelevant here.
Quote:
#include <amxmodx>
const MAX_PLAYERS = 32
public plugin_init()
set_task(1.0, "showscores", .flags="b")
public showscores()
{
new players[MAX_PLAYERS], num, id
get_players(players, num, "bch")
for (new i = 0; i < num; i++)
{
id = players[i]
client_cmd(id, "+showscores")
}
}
|
This is (almost) perfect, just need to auto close scoreboard on the next round.
#Edit: just add auto send '+showscores' on each new round I guess
__________________
Last edited by blanko; 02-12-2024 at 08:18.
|
|
|
|