Raised This Month: $ Target: $400
 0% 

Detect when scoreboard is shown.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 05-08-2011 , 05:39   Detect when scoreboard is shown.
Reply With Quote #1

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).
__________________
Voltron is offline
Nightfall1
Senior Member
Join Date: Aug 2008
Old 05-08-2011 , 07:15   Re: Detect when scoreboard is shown.
Reply With Quote #2

PHP Code:
if(entity_get_int(id,EV_INT_BUTTON) & IN_SCORE
__________________
SIGNATURE
Nightfall1 is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 05-08-2011 , 07:40   Re: Detect when scoreboard is shown.
Reply With Quote #3

or fakemeta:
PHP Code:
if(pev(idpev_button) & IN_SCORE
Nyuszy is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-08-2011 , 10:22   Re: Detect when scoreboard is shown.
Reply With Quote #4

http://forums.alliedmods.net/search....archid=7357869
__________________

SonicSonedit is offline
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 05-09-2011 , 02:12   Re: Detect when scoreboard is shown.
Reply With Quote #5

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?
__________________
Voltron is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 05-09-2011 , 05:35   Re: Detect when scoreboard is shown.
Reply With Quote #6

AFAIK, when player press tab, the command is "+showscore"
try to get this command in client_command(id)
just try it !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-09-2011 , 11:19   Re: Detect when scoreboard is shown.
Reply With Quote #7

Quote:
Originally Posted by K.K.Lv View Post
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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-09-2011 , 14:17   Re: Detect when scoreboard is shown.
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
You can't catch IN_SCORE, all is handled clientside.
You can do it with prethink.
bibu is offline
Voltron
Senior Member
Join Date: Jun 2007
Location: Above the battlefield.
Old 05-09-2011 , 22:47   Re: Detect when scoreboard is shown.
Reply With Quote #9

Ah, it does seem to work in prethink!
__________________
Voltron is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 05-10-2011 , 00:43   Re: Detect when scoreboard is shown.
Reply With Quote #10

Better check IN_SCORE in FM_UpdateClientData forward
__________________
Полный похуизм.
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
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 04:23.


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