AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   HUD (https://forums.alliedmods.net/showthread.php?t=312121)

PastyBully 11-17-2018 04:19

HUD
 
efzfez

TheWho 11-19-2018 04:46

Re: HUD
 
maybe try to check every bit and see if your lucky?
Code:

public void OnClientPutInServer(int client)
{
        SDKHook(client, SDKHook_PreThinkPost, Hook_PreThinkPost);
}

public void Hook_PreThinkPost(int client)
{
        for(int j = 3; j<64; j++)
        {
                int flags = GetEntProp(client, Prop_Send, "m_iHideHUD");
                SetEntProp(client, Prop_Send, "m_iHideHUD", flags | (1<<j));
        }
}

oh and btw the first two are for hiding everything so start with 3!

Code:

#define hideeverything (1<<1)
#define showhud (1<<2)
#define hidehud (1>>2)


and maybe this works for you:
Quote:

Originally Posted by Bacardi (Post 2623296)
Well, player HUD will behavior on game events, like bomb_planted, round_end and so on.
And when game_type is changed, but then player need reconnect to server.

These are more client side effect.

Here one example. For classic game play (game_type 0)
This hide clock digits, like for example when round_end. But bad side is, you also here "Round Draw" :(
And this event is send to players, and will not disturp other SM plugins by fake events.
PHP Code:

public void OnPluginStart()
{
    
HookEvent("round_freeze_end"round_freeze_endEventHookMode_PostNoCopy);
}

public 
void round_freeze_end(Event event, const char[] namebool dontBroadcast)
{

    
Event event CreateEvent("round_end");
    
event.SetInt("winner"1);

    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && !IsFakeClient(i)) event.FireToClient(i);
    }

    
delete event;




Mitchell 11-19-2018 12:38

Re: HUD
 
Quote:

Originally Posted by TheWho (Post 2624710)
oh and btw the first two are for hiding everything so start with 3!

Says who? https://github.com/ValveSoftware/sou...fs.h#L194-L205

shavit 11-21-2018 00:49

Re: HUD
 
Quote:

Originally Posted by TheWho (Post 2624710)
maybe try to check every bit and see if your lucky?
Code:

public void OnClientPutInServer(int client)
{
        SDKHook(client, SDKHook_PreThinkPost, Hook_PreThinkPost);
}

public void Hook_PreThinkPost(int client)
{
        for(int j = 3; j<64; j++)
        {
                int flags = GetEntProp(client, Prop_Send, "m_iHideHUD");
                SetEntProp(client, Prop_Send, "m_iHideHUD", flags | (1<<j));
        }
}


up to 63? sourcepawn data types are 4 bytes (32 bits), this shouldn't work as intended


All times are GMT -4. The time now is 21:36.

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