AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   scoreboard possible (https://forums.alliedmods.net/showthread.php?t=215158)

ironskillz1 05-04-2013 09:58

scoreboard possible
 
Is it possible to detect if someone opens the scoreboard and if someone closes it?

daniel46 05-04-2013 10:10

Re: scoreboard possible
 
you need to detect if he click on IN_SCORE

Code:

static iButton
        iButton = get_uc(handle, UC_Buttons)
       
        if(iButton & IN_SCORE)


ironskillz1 05-04-2013 10:17

Re: scoreboard possible
 
Found this
Why aint it working?
Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define VERSION "0.0.1"
#define PLUGIN "scoreboard detection"
#define XO_PLAYER 5
#define m_afButtonPressed 246
#define m_afButtonReleased 247
new bool:g_bPlayerInScore[33]
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, "ConnorMcLeod")
    RegisterHam(Ham_Player_PreThink, "player", "CBasePlayer_PreThink__Post", 1)
}
public client_putinserver( id )
{
    g_bPlayerInScore[id] = false
}
public CBasePlayer_PreThink__Post( id )
{
    if( !g_bPlayerInScore[id] )
    {
        if( get_pdata_int(id, m_afButtonPressed) & IN_SCORE )
        {
            g_bPlayerInScore[id] = true
            client_print(id, print_chat, "ScoreBoard Open");
        }
    }
    else if( get_pdata_int(id, m_afButtonReleased) & IN_SCORE )
    {
        g_bPlayerInScore[id] = false
        client_print(id, print_chat, "ScoreBoard Closed");
    }
}


hornet 05-04-2013 10:28

Re: scoreboard possible
 
Works just fine.

ironskillz1 05-04-2013 10:34

Re: scoreboard possible
 
Quote:

Originally Posted by hornet (Post 1945594)
Works just fine.


Have you tested?
when i press TAB it doesnt shows anything in the chat

hornet 05-04-2013 10:43

Re: scoreboard possible
 
I did. Can only assume you haven't enabled it or something alike.

ironskillz1 05-04-2013 11:08

Re: scoreboard possible
 
Quote:

Originally Posted by hornet (Post 1945606)
I did. Can only assume you haven't enabled it or something alike.

working now

Somehow it didnt work on my test server
but it did work on my real server


All times are GMT -4. The time now is 10:51.

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