Can't hide HUD with TogglePlayerSpectating?
#1

Hello, I was reading that it is possible to hide hud with TogglePlayerSpectating. I've set it to 1 in OnPlayerConnect, but hud is still showing, so I've created new test gamemode where I have only this and HUD is still shown:

pawn Код:
#include "a_samp"

main()
{
   
}

public OnPlayerConnect(playerid)
{
    TogglePlayerSpectating(playerid, 1);
        return 1;
}
Reply
#2

I found this:
Код:
new _HUDtimer[MAX_PLAYERS] = {-1, ... };

stock HidePlayerHUD(playerid)
{
     return (_HUDtimer[playerid] = SetTimerEx("RepeatLevel", 1000, 1, "d", playerid));
}

forward public RepeatLevel(playerid);

public RepeatLevel(playerid)
{
   return (SetPlayerDrunkLevel(playerid, 2001)) ;
}

stock ShowPlayerHUD(playerid)
{ 
    if(_HUDtimer[playerid] != -1) KillTimer _HUDtimer[playerid]) ;
}
Credits to RajatPawar for this code.
Simply use HidePlayerHUD(playerid) to hide the hud and ShowPlayerHUD(playerid) to show it again.
Reply
#3

Okay, so I've tried drunk level hide method, in code updated drunk level to higher than 5000 according to wiki.
Quote:

While the drunk level is above 5000, the player's HUD (radar etc.) will be hidden.

Still not working, my screen is drunk when I test it, but hud is still on.

//EDIT: Hah I found the problem, problem wasn't in script but I had installed ****** for testing purposes it was blocking it. Thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)