View Single Post
blanko
Senior Member
Join Date: Aug 2008
Old 02-12-2024 , 08:14   Re: [req] auto scoreboard on ded screen
Reply With Quote #8

Quote:
Originally Posted by bigdaddy424 View Post
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(0loguser79)
    
parse_loguser(logusername31)

    new 
id get_user_index(name)

    if(
is_user_bot(id) && is_user_hltv(id))
        return

    new 
temp[2]
    
read_logargv(2temp1)
    
    switch(
temp[0])
    {
        case 
'T''C''S' joined[id] = true
        
default: joined[id] = false
    
}
}

public 
showscores()
{
    new 
players[MAX_PLAYERS], numid
    get_players
(playersnum"bch")

    for (new 
0numi++)
    {
        
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.
blanko is offline