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

Solved Disable Train HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-08-2018 , 08:52   Disable Train HUD
Reply With Quote #1

Hello, is there any way to disable the train hud that shows when controlling a train? I want if somehow I'm getting dropped out of the train to hide the message, because it's still there. Thanks !

Last edited by DarthMan; 11-08-2018 at 15:07. Reason: Solved
DarthMan is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-08-2018 , 09:42   Re: Disable Train HUD
Reply With Quote #2

https://wiki.alliedmods.net/Half-Lif...e_Events#Train

Is that message?
baneado is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-08-2018 , 10:48   Re: Disable Train HUD
Reply With Quote #3

Quote:
Originally Posted by baneado View Post
Yeah, that's the message.

Here's what I did:

Code:
UnUseTrain(const iID) {     static iFlags;     iFlags = pev(iID, pev_flags);         if(iFlags & FL_ONTRAIN)         set_pev(iID, pev_flags, iFlags & ~FL_ONTRAIN);         static iButtons;     pev(iID, pev_button, iButtons);         if(iButtons & IN_USE)     {         set_pev(iID, pev_button, iButtons & ~IN_USE);         set_pev(iID, pev_oldbuttons, pev(iID, pev_oldbuttons) | IN_USE);     }         message_begin(MSG_ONE, g_iTrainMsg, _, iID);     write_byte(0);     message_end(); }

The problem is if I press w, for example, the hud shows again.

Last edited by DarthMan; 11-08-2018 at 10:50.
DarthMan is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 11-08-2018 , 14:15   Re: Disable Train HUD
Reply With Quote #4

Hook the message (register_message) and alter it: set_msg_arg_int(1, ARG_BYTE, 0).
__________________
My English is A0
E1_531G is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-08-2018 , 14:25   Re: Disable Train HUD
Reply With Quote #5

Quote:
Originally Posted by E1_531G View Post
Hook the message (register_message) and alter it: set_msg_arg_int(1, ARG_BYTE, 0).
But that would block it entiely from apeparing at any time. I just want to fix the bug when player is not on train but the hud is still there.
DarthMan is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 11-08-2018 , 15:07   Re: Disable Train HUD
Reply With Quote #6

Solved, just had to deal with m_afPhysicsFlags offset.
So m_afPhysicsFlags &= ~PFLAG_ONTRAIN;
DarthMan is offline
Reply


Thread Tools
Display Modes

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 20:07.


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