Raised This Month: $51 Target: $400
 12% 

Solved [req] auto scoreboard on ded screen


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blanko
Senior Member
Join Date: Aug 2008
Old 02-11-2024 , 01:25   [req] auto scoreboard on ded screen
Reply With Quote #1

Keep the scoreboard on screen while dead/spectator
__________________

Last edited by blanko; 02-12-2024 at 13:46. Reason: solved
blanko is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 02-11-2024 , 09:35   Re: [req] auto scoreboard on ded screen
Reply With Quote #2

its rather annoying
PHP Code:
public plugin_init()
    
set_task(1.0"showscores", .flags="b")

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

    for (new 
0numi++)
    {
        
id players[i]
        
client_cmd(id"+showscores")
    }

__________________
bigdaddy424 is offline
blanko
Senior Member
Join Date: Aug 2008
Old 02-11-2024 , 14:15   Re: [req] auto scoreboard on ded screen
Reply With Quote #3

Quote:
Originally Posted by bigdaddy424 View Post
PHP Code:
public plugin_init()
    
set_task(1.0"showscores", .flags="b")

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

    for (new 
0numi++)
    {
        
id players[i]
        
client_cmd(id"+showscores")
    }

I'm new here so I don't know how to make this into a whole plugin yet... Sadly I'm not new hier but never figured out much 'bout scripting plugins.

Quote:
its rather annoying
Works fine to mp_fadetoblack 1
__________________
blanko is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 02-11-2024 , 16:17   Re: [req] auto scoreboard on ded screen
Reply With Quote #4

Quote:
Originally Posted by blanko View Post
I'm new here ...
funny that you say it, you have been registered longer than me.

regarding the plugin, well yes, it is tedious, I was looking for a better way but it seems that we are dealing with a command handled by the client, there is not much that can be done.
__________________
mlibre is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 02-11-2024 , 17:40   Re: [req] auto scoreboard on ded screen
Reply With Quote #5

paste
PHP Code:
#include <amxmodx>
const MAX_PLAYERS 32

public plugin_init()
    
set_task(1.0"showscores", .flags="b")

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

    for (new 
0numi++)
    {
        
id players[i]
        
client_cmd(id"+showscores")
    }

to https://www.amxmodx.org/webcompiler.cgi
__________________
bigdaddy424 is offline
blanko
Senior Member
Join Date: Aug 2008
Old 02-11-2024 , 21:24   Re: [req] auto scoreboard on ded screen
Reply With Quote #6

Quote:
funny that you say it, you have been registered longer than me.


Quote:
Originally Posted by bigdaddy424 View Post
paste
PHP Code:
#include <amxmodx>
const MAX_PLAYERS 32

public plugin_init()
    
set_task(1.0"showscores", .flags="b")

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

    for (new 
0numi++)
    {
        
id players[i]
        
client_cmd(id"+showscores")
    }

to https://www.amxmodx.org/webcompiler.cgi


Works fine, except that's still there when you come back to life next round...
__________________
blanko is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 02-11-2024 , 21:49   Re: [req] auto scoreboard on ded screen
Reply With Quote #7

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")
    }

__________________
bigdaddy424 is offline
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
JocAnis
Veteran Member
Join Date: Jun 2010
Old 02-12-2024 , 10:51   Re: [req] auto scoreboard on ded screen
Reply With Quote #9

try this?
Code:
#include <amxmodx>

const MAX_PLAYERS = 32

public plugin_init()
{
    register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
    set_task(1.0, "showscores", .flags="b")
}
public event_new_round()
{
    for( new id = 1; id <= get_maxplayers(); id++ )
    {
        if( !is_user_connected( id ) )
            continue

        client_cmd( id, "-showscores" )
    }
}
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")
    }
}
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 02-12-2024 at 10:52.
JocAnis is offline
blanko
Senior Member
Join Date: Aug 2008
Old 02-12-2024 , 13:46   Re: [req] auto scoreboard on ded screen
Reply With Quote #10

Quote:
Originally Posted by JocAnis View Post
try this?
Code:
#include <amxmodx>

const MAX_PLAYERS = 32

public plugin_init()
{
    register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
    set_task(1.0, "showscores", .flags="b")
}
public event_new_round()
{
    for( new id = 1; id <= get_maxplayers(); id++ )
    {
        if( !is_user_connected( id ) )
            continue

        client_cmd( id, "-showscores" )
    }
}
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")
    }
}


solved, thanks buddy
__________________
blanko is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode