diff --git a/resource/interface/client/skillcheck.lua b/resource/interface/client/skillcheck.lua new file mode 100644 index 0000000..4bc2aba --- /dev/null +++ b/resource/interface/client/skillcheck.lua @@ -0,0 +1,19 @@ +local skillcheck + +function lib.skillCheck(difficulty) + if skillcheck then return end + skillcheck = promise:new() + SetNuiFocus(true, false) + SendNUIMessage({ + action = 'startSkillCheck', + data = difficulty + }) + return Citizen.Await(skillcheck) +end + +RegisterNUICallback('skillCheckOver', function(data, cb) + cb(1) + skillcheck:resolve(data.success) + skillcheck = nil + SetNuiFocus(false, false) +end) \ No newline at end of file diff --git a/web/src/features/skillcheck/indicator.tsx b/web/src/features/skillcheck/indicator.tsx index 80ad714..1e8c70b 100644 --- a/web/src/features/skillcheck/indicator.tsx +++ b/web/src/features/skillcheck/indicator.tsx @@ -17,7 +17,6 @@ const Indicator: React.FC = ({ angle, offset, multiplier, setSkillCheck } const isKeyPressed = useKeyPress('e'); useEffect(() => { - console.log(1); intervalRef.current = setInterval(() => { setIndicatorAngle((prevState) => (prevState += multiplier)); }, 1);