getCameraDrunkLevel | Multi Theft Auto: Wiki Skip to content

getCameraDrunkLevel

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function gets the camera drunk level set by setCameraDrunkLevel. This function was renamed from getCameraShakeLevel.

Syntax

getCameraDrunkLevel ( )

Code Examples

client

This example checks for changes in the camera drunk level of any player every frame and outputs different messages according to it.

local lastDrunkLevel = getCameraDrunkLevel()
local function warnPlayerAboutDrunkenness()
local currentDrunkLevel = getCameraDrunkLevel()
if currentDrunkLevel ~= lastDrunkLevel and (currentDrunkLevel == 0 or currentDrunkLevel == 255) then
outputChatBox(currentDrunkLevel == 255 and "You're completly drunk! You should stop drinking!" or "Now you are completely sober! You sohuld keep it like that.", currentDrunkLevel == 255 and 255 or 0, currentDrunkLevel == 0 and 255 or 0, 0)
end
lastDrunkLevel = currentDrunkLevel
end
addEventHandler("onClientRender", root, warnPlayerAboutDrunkenness)