OnPlayerDrunk
The player got drunk, or sobered up.
true when the blood-alcohol level crossed [combat] drunk_threshold upwards (the game’s drunkenness is on, the others see
the body sway); false when it fell back under half of it (the hangover follows for [combat] hangover_seconds).
Syntax
Section titled “Syntax”function OnPlayerDrunk(pid, drunk) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the player |
drunk |
boolean | true = drunk now, false = sober again |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnPlayerDrunk(pid, drunk) SendClientMessageToAll(COLOUR_SERVER, GetPlayerName(pid) .. (drunk and " has had one too many" or " is sober again"))endSee also
Section titled “See also”GetPlayerAlcohol · IsPlayerDrunk · SetPlayerAlcohol · the Buffs and the drink group of the index
