SA-MP Forums Archive
Toggling player HUD - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Toggling player HUD (/showthread.php?tid=656580)



Toggling player HUD - FedeA - 19.07.2018

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!


Re: Toggling player HUD - RedRex - 19.07.2018

Show us your code!


Re: Toggling player HUD - FedeA - 19.07.2018

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.


Re: Toggling player HUD - IdonTmiss - 19.07.2018

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

https://sampwiki.blast.hk/wiki/TogglePlayerSpectating


Re: Toggling player HUD - FedeA - 19.07.2018

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.


Re: Toggling player HUD - FedeA - 20.07.2018

Bump.