Toggling player HUD
#1

Hello, iґm attempting to toggle off the HUD of the player, because iґm making a custom one.

I found a function using SetPlayerDrunkLevel, but didnґt work properly, so iґm looking for help to do this.

Thanks!
Reply
#2

Show us your code!
Reply
#3

Quote:
Originally Posted by RedRex
Посмотреть сообщение
Show us your code!
The code was 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]) ;
}
Didnґt work, i read the wiki of SetPlayerDrunkLevel and the function of toggling off the HUD was if the value was above of 5000, so i put it in 5001. The HUD was toggled, but isnґt a good way of toggling the HUD, because itґs difficult to drive vehicles / walk with that drunk level.
Reply
#4

Just hide the textdraws, and use "TogglePlayerSpectating" player can toggle their hud by pressing F7

https://sampwiki.blast.hk/wiki/TogglePlayerSpectating
Reply
#5

Quote:
Originally Posted by IdonTmiss
Посмотреть сообщение
Just hide the textdraws, and use "TogglePlayerSpectating" player can toggle their hud by pressing F7

https://sampwiki.blast.hk/wiki/TogglePlayerSpectating
I'm making a custom HUD using TDs..
Using F7 isn't effective, im not taking screenshots, im doing a custom hud.
TogglePlayerSpectating also isn't good, i cannot control my character.

Also, thanks for the suggestion, but isn't possible in this case.
Reply
#6

Bump.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)