AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect when scoreboard is shown. (https://forums.alliedmods.net/showthread.php?t=156535)

Voltron 05-08-2011 05:39

Detect when scoreboard is shown.
 
How can I do this?
Because I would like to show a hud message whenever a player presses tab (or whatever key they have for showing the scoreboard).

Nightfall1 05-08-2011 07:15

Re: Detect when scoreboard is shown.
 
PHP Code:

if(entity_get_int(id,EV_INT_BUTTON) & IN_SCORE


Nyuszy 05-08-2011 07:40

Re: Detect when scoreboard is shown.
 
or fakemeta:
PHP Code:

if(pev(idpev_button) & IN_SCORE


SonicSonedit 05-08-2011 10:22

Re: Detect when scoreboard is shown.
 
http://forums.alliedmods.net/search....archid=7357869

Voltron 05-09-2011 02:12

Re: Detect when scoreboard is shown.
 
PHP Code:

public FwdCmdStart(iduc_handle)
{
        static 
ButtonOldButtons;
        
Button get_uc(uc_handleUC_Buttons);
        
OldButtons pev(idpev_oldbuttons);
       
        if((
Button IN_SCORE) && !(OldButtons IN_SCORE))
        {
                
client_print(idprint_chat"tab pressed");
        }


Doesn't work.
But if I substitute IN_SCORE with IN_USE, it does!

What's up with that?

K.K.Lv 05-09-2011 05:35

Re: Detect when scoreboard is shown.
 
AFAIK, when player press tab, the command is "+showscore"
try to get this command in client_command(id)
just try it !

ConnorMcLeod 05-09-2011 11:19

Re: Detect when scoreboard is shown.
 
Quote:

Originally Posted by K.K.Lv (Post 1466038)
AFAIK, when player press tab, the command is "+showscore"
try to get this command in client_command(id)
just try it !

You can't catch IN_SCORE and you can't hook that command +showscore, all is handled clientside.

bibu 05-09-2011 14:17

Re: Detect when scoreboard is shown.
 
Quote:

Originally Posted by ConnorMcLeod (Post 1466187)
You can't catch IN_SCORE, all is handled clientside.

You can do it with prethink.

Voltron 05-09-2011 22:47

Re: Detect when scoreboard is shown.
 
Ah, it does seem to work in prethink! :)

Flipper_SPb 05-10-2011 00:43

Re: Detect when scoreboard is shown.
 
Better check IN_SCORE in FM_UpdateClientData forward


All times are GMT -4. The time now is 04:23.

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