1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-13 14:27:28 +02:00
parent 48844d7321
commit 769454360e
72 changed files with 734 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1,70 @@
Config = {}
-- 'QB' = For QBCore Framework
-- 'ESX' = For ESX Framework
-- false = For Standalone
Config.ServerType = 'QB' --['QB'|'ESX'|false]
Config.OpenUI = {
useCommand = false,
Command_Name = 'atest',
useItem = true, --Enable ServerType in sv_function.lua
Item_Name = 'breathalyzer'
}
Config.Wait_TIme = 2 --Blower Waiting Time in seconds
Config.Animations = {
Enable = true,
Tester_Prop = `prop_inhaler_01`,
Share_Anim = 'package_dropoff',
Share_Dict = 'mp_safehouselost@',
Use_Anim = 'loop',
Use_Dict = 'mp_player_inteat@pnq'
}
Config.DrunkLevel = {
[25] = 'green', --Low Value [25 means upto 25 is low value of drunk]
[70] = 'yellow', --Mid Value
[100] = 'red' --High Value
}
Config.DrunkSettings = {
Enable = true, --Enble/Disable Drunk Value Deductions after certain time
Reduce_Interval = 0.5, --This will reduce alcholic level after certain minutes (In Minutes)
Reduce_Level = 2 --Reduce Level
}
Config.DrunkEffect = false --Enble/Disable Drunk Effect
Config.Effect_Interval = {
--You can add more stages if you want
[10] = { --Drunk Level at which this Effect will occur
Enable = true, --Enable/Disable Stage
Animation = 'move_m@drunk@a' --WalkStyle
},
[40] = {
Enable = true,
Animation = 'move_m@drunk@moderatedrunk'
},
[80] = {
Enable = true,
Animation = 'move_m@drunk@slightlydrunk'
},
[95] = { --Heavy Drunk Max Stage
Enable = true,
Animation = 'move_m@drunk@verydrunk'
},
}
----Language Editor----
Config.Language = {
wait_blow = 'WAIT',
blow_txt = 'BLOW',
tester_share = 'Alchohol Tester Given to Nearby Player',
tester_smoke = 'Tell Nearest Player to Blow Air'
}

View file

@ -0,0 +1,44 @@
function Notificaton(msg)
lib.notify({
title = 'Drunk',
description = msg
})
end
function RequestWalking(set)
RequestAnimSet(set)
while not HasAnimSetLoaded(set) do
Wait(1)
end
end
function isDrunk()
return isDrunk
end
exports('isDrunk', isDrunk)
function GetDrunkLevel()
return lib.callback.await('cs:drunk:fetch', false, 'get')
end
exports('GetDrunkLevel', GetDrunkLevel)
function SetDrunkLevel(valueS)
local valueS = type(valueS) == 'table' and valueS.client.value or valueS
if not valueS then return 0 end
return lib.callback.await('cs:drunk:fetch', false, 'set', valueS)
end
exports('SetDrunkLevel', SetDrunkLevel)
function AddDrunkLevel(valueS)
local valueS = type(valueS) == 'table' and valueS.client.value or valueS
if not valueS then return 0 end
return lib.callback.await('cs:drunk:fetch', false, 'add', valueS)
end
exports('AddDrunkLevel', AddDrunkLevel)
function RemoveDrunkLevel(valueS)
local valueS = type(valueS) == 'table' and valueS.client.value or valueS
if not valueS then return 0 end
return lib.callback.await('cs:drunk:fetch', false, 'remove', valueS)
end
exports('RemoveDrunkLevel', RemoveDrunkLevel)

View file

@ -0,0 +1,27 @@
if Config.ServerType == "QB" then
QBCore = exports['qb-core']:GetCoreObject()
elseif Config.ServerType == "ESX" then
ESX = exports['es_extended']:getSharedObject()
end
if Config.OpenUI.useCommand then
lib.addCommand(Config.OpenUI.Command_Name, {
help = 'Open Breathalyzer ',
}, function(source)
TriggerClientEvent('cs:drunk:openUI', source)
end)
end
if Config.OpenUI.useItem then
if Config.ServerType == 'ESX' then
ESX.RegisterUsableItem(Config.OpenUI.Item_Name, function(source)
TriggerClientEvent('cs:drunk:openUI', source)
end)
elseif Config.ServerType == 'QB' then
QBCore.Functions.CreateUseableItem(Config.OpenUI.Item_Name, function(source)
TriggerClientEvent('cs:drunk:openUI', source)
end)
else
--YOU CAN ADD YOUR CUSTOM EVENTS HERE
end
end

View file

@ -0,0 +1,19 @@
fx_version 'adamant'
version '1.2'
game 'gta5'
description 'Drunk Test Analyzer'
ui_page 'ui/index.html'
shared_scripts {'@ox_lib/init.lua', 'config/config.lua'}
client_scripts {'main/client.lua', 'config/functions/cl_function.lua'}
server_scripts {'main/server.lua', 'config/functions/sv_function.lua'}
files {'ui/**'}
escrow_ignore {'config/**'}
dependencies {'ox_lib'}
lua54 'yes'
dependency '/assetpacks'

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
<img src="image/tester.png" class="tester-img" />
<div class="main-inside">
<div class="wait-screen">
<p class="wait-text wait-txt">Wait</p>
<div id="progressBar">
<span id="progressBar-value"></span>
</div>
</div>
<div class="blow-screen">
<p class="wait-text blow-txt">Blow</p>
<div style="display: flex; align-items: center; justify-content: space-evenly;">
<p class="wait-text">Air</p>
<img src="image/inhaler.png" />
</div>
</div>
<div class="result-screen" id="green">
<p class="time-text">88%</p>
<p class="bac-text">% BAC</p>
</div>
</div>
<div class="buttons">
<div class="button-1" id="power">
<img src="image/power-on.png" class="power-button" />
</div>
<div class="button-1" id="reset">
<img src="image/reload.png" class="power-button" />
</div>
</div>
<div class="blow-tip">
<span class="tooltiptext blow-txt">BLOW</span>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script src="main.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,261 @@
@font-face {
font-family: Digital;
src: url(digital-7.ttf);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
}
body {
user-select: none;
overflow: hidden;
}
.container {
display: none;
position: absolute;
top: 40vh;
--animate-duration: 0.4s;
right: 0;
}
.tester-img {
height: 550px;
width: 550px;
user-select: none;
}
.main-inside {
height: 83px;
width: 120px;
position: absolute;
top: 173px;
right: 211px;
border-radius: 5px;
background-color: #3a3838;
}
.start-effect {
display: block;
animation: theme 3s linear infinite;
}
#red {
background-color: #c5374f;
}
#green {
background-color: #50c25b;
}
#yellow {
background-color: #dbdd62;
}
@keyframes theme {
0% {
background: #74c390;
}
16% {
background: #5dbdb6;
}
33% {
background: #59d4e1;
}
50% {
background: #51bce8;
}
66% {
background: #fa5374;
}
83% {
background: #e46653;
}
100% {
background: #74c390;
}
}
@keyframes background {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.wait-screen {
height: 83px;
width: 120px;
border-radius: 5px;
background-color: #b5b2b5;
display: none;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
}
.blow-screen {
display: none;
height: 83px;
width: 120px;
border-radius: 5px;
background-color: #b5b2b5;
}
.wait-text {
font-size: 30px;
font-family: sans-serif;
text-align: center;
text-transform: uppercase;
font-weight: 800;
color: #2e2c2e;
}
.time-text {
padding-top: 15px;
font-size: 50px;
color: #111111;
font-family: Digital;
text-align: center;
text-transform: uppercase;
font-weight: 800;
}
.bac-text {
font-family: sans-serif;
font-weight: 900;
font-size: 12px;
text-align: end;
padding-right: 5px;
}
#progressBar {
border-radius: 10px;
width: 100px;
height: 10px;
border: 1px solid #2e2c2e;
position: relative;
}
#progressBar span {
display: block;
height: 100%;
background-color: #2e2c2e;
position: absolute;
top: 0;
left: 0;
animation: progressBar 10s linear forwards;
}
@keyframes progressBar {
0% {
width: 0%;
}
100% {
width: 100%;
}
}
.result-screen {
display: none;
height: 83px;
width: 120px;
border-radius: 5px;
}
.buttons {
background-color: #111111;
height: 36px;
width: 130px;
position: absolute;
top: 286px;
right: 205px;
display: flex;
align-items: center;
justify-content: space-around;
cursor: pointer;
}
.button-1 {
display: flex;
align-items: center;
justify-content: center;
height: 35px;
width: 35px;
border-radius: 50px;
background: rgb(254, 255, 255);
background: radial-gradient(
circle,
rgba(254, 255, 255, 0.6558998599439776) 0%,
rgba(0, 0, 0, 1) 100%
);
}
.power-button {
height: 25px;
width: 25px;
}
.blow-tip {
display: none;
height: 53px;
width: 110px;
position: absolute;
left: 87px;
top: 31px;
transform: rotate(17deg);
cursor: pointer;
}
.blow-tip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #000000a1;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 2px 0;
position: absolute;
z-index: 1;
top: -45px;
font-weight: 900;
font-family: sans-serif;
height: 30px;
transform: rotate(-16deg);
}
.blow-tip:hover .tooltiptext {
visibility: visible;
}
@keyframes slideUp {
0% {
transform: translateY(100%);
opacity: 0;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
.slide-up {
animation: slideUp 0.5s ease-out forwards;
}
@keyframes slideDown {
0% {
transform: translateY(0);
opacity: 1;
}
100% {
transform: translateY(100%);
opacity: 0;
}
}
.slide-down {
animation: slideDown 0.5s ease-out forwards;
}