API
rcore_drunk 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(number)
return true/false if the player has the above "number".
AddPlayerHeadachePercentage(number)
will add a percentage to the headache status.
RemovePlayerHeadachePercentage(number)
will do the opposite of the one above.
SetPlayerHeadachePercentage(number)
will set the headache percentage level.
Drunk
GetPlayerDrunkPercentage()
return value between 0-100
IsPlayerDrunkAtLevel(number)
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(number)
return true/false if the player has the above "number".
AddPlayerDrunkPercentage(number)
will add a percentage to the headache status.
RemovePlayerDrunkPercentage(number)
will do the opposite of the one above
SetPlayerDrunkPercentage(number)
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)
-- 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)
Last updated
Was this helpful?