AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Disable Train HUD (https://forums.alliedmods.net/showthread.php?t=311925)

DarthMan 11-08-2018 08:52

Disable Train HUD
 
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 !

baneado 11-08-2018 09:42

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

Is that message?

DarthMan 11-08-2018 10:48

Re: Disable Train HUD
 
Quote:

Originally Posted by baneado (Post 2623111)

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.

E1_531G 11-08-2018 14:15

Re: Disable Train HUD
 
Hook the message (register_message) and alter it: set_msg_arg_int(1, ARG_BYTE, 0).

DarthMan 11-08-2018 14:25

Re: Disable Train HUD
 
Quote:

Originally Posted by E1_531G (Post 2623149)
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 11-08-2018 15:07

Re: Disable Train HUD
 
Solved, just had to deal with m_afPhysicsFlags offset.
So m_afPhysicsFlags &= ~PFLAG_ONTRAIN;


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

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