19.07.2018, 01:32
The code was this:
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.
Код:
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]) ;
}

