# API

## other exports

All exports are used from the client side only.

* SetBlockingStatusForDrunk(bool)

  ```
  This will block all drunk event (drunk walking, drunk screen, echo, everything)
  ```
* IsDrunkBlocked()

  ```
  This will return true/false if the status were blocked
  ```

### Headache

All exports are used from the client side only.

* GetPlayerHeadachePercentage()

  ```
  return value between 0-100.
  ```
* HasPlayerHeadache()

  ```
  return true/false if the player has a headache.
  ```
* IsPlayerHeadacheAtPercentage(<mark style="color:orange;">**number**</mark>)

  ```
  return true/false if the player has the above "number".
  ```
* AddPlayerHeadachePercentage(<mark style="color:orange;">**number**</mark>)

  ```
  will add a percentage to the headache status.
  ```
* RemovePlayerHeadachePercentage(<mark style="color:orange;">**number**</mark>)

  ```
  will do the opposite of the one above.
  ```
* SetPlayerHeadachePercentage(<mark style="color:orange;">**number**</mark>)

  ```
   will set the headache percentage level.
  ```

### Drunk

* GetPlayerDrunkPercentage()

  ```
  return value between 0-100
  ```
* IsPlayerDrunkAtLevel(<mark style="color:orange;">**number**</mark>)

  ```
  return true/false if the player has the above "number".
  ```
* GetPlayerDrunkLevel()

  ```
  return a value between 0-4 which represents this enum

  DrunkLevel = {
      NONE = 0,
      LITTLE = 1,
      MODERATELY = 2,
      HIGH = 3,
      MAXIMUM = 4,
  }
  ```
* IsPlayerDrunk()

  ```
  return true/false if the player has more than 20% percentage
  ```
* IsPlayerDrunkAtPercentage(<mark style="color:orange;">**number**</mark>)

  ```
  return true/false if the player has the above "number".
  ```
* AddPlayerDrunkPercentage(<mark style="color:orange;">**number**</mark>)

  ```
  will add a percentage to the headache status.
  ```
* RemovePlayerDrunkPercentage(<mark style="color:orange;">**number**</mark>)

  ```
  will do the opposite of the one above
  ```
* SetPlayerDrunkPercentage(<mark style="color:orange;">**number**</mark>)

  ```
  will set the drunk percentage level.
  ```
* GetMilligramsAlcoholInBlood()

  ```
  will return milligrams of alcohol in the blood 
  it is the same value as in the breath tester
  ```

### Events (server/client sided)

```lua
-- when a player sips from the bottle this event gets called
AddEventHandler("rcore_drunk:PlayerSippedDrink", function(drinkName)
   print(drinkName)
end)

-- when play finishes drinking a bottle this event gets called
AddEventHandler("rcore_drunk:OnBottleFinish", function(drinkName)
    print(drinkName)
end)
```
