AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved [req] auto scoreboard on ded screen (https://forums.alliedmods.net/showthread.php?t=346149)

blanko 02-11-2024 01:25

[req] auto scoreboard on ded screen
 
Keep the scoreboard on screen while dead/spectator

bigdaddy424 02-11-2024 09:35

Re: [req] auto scoreboard on ded screen
 
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")
    }



blanko 02-11-2024 14:15

Re: [req] auto scoreboard on ded screen
 
Quote:

Originally Posted by bigdaddy424 (Post 2817896)
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

mlibre 02-11-2024 16:17

Re: [req] auto scoreboard on ded screen
 
Quote:

Originally Posted by blanko (Post 2817909)
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.

bigdaddy424 02-11-2024 17:40

Re: [req] auto scoreboard on ded screen
 
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

blanko 02-11-2024 21:24

Re: [req] auto scoreboard on ded screen
 
Quote:

funny that you say it, you have been registered longer than me.
https://c.tenor.com/Jf1PLtSreWgAAAAC/tenor.gif

Quote:

Originally Posted by bigdaddy424 (Post 2817920)
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

https://www.theforage.com/blog/wp-co...or-WP-post.png

Works fine, except that's still there when you come back to life next round...

bigdaddy424 02-11-2024 21:49

Re: [req] auto scoreboard on ded screen
 
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")
    }



blanko 02-12-2024 08:14

Re: [req] auto scoreboard on ded screen
 
Quote:

Originally Posted by bigdaddy424 (Post 2817932)
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")
    }



https://media.tenor.com/QDdMxaJsZWUA...jk-simmons.png
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

JocAnis 02-12-2024 10:51

Re: [req] auto scoreboard on ded screen
 
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")
    }
}


blanko 02-12-2024 13:46

Re: [req] auto scoreboard on ded screen
 
Quote:

Originally Posted by JocAnis (Post 2817966)
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")
    }
}


https://freeimghost.net/images/2024/...c79f724e2.jpeg

solved, thanks buddy


All times are GMT -4. The time now is 14:48.

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