diff --git a/client/client.js b/client/client.js new file mode 100644 index 0000000..6f7c02c --- /dev/null +++ b/client/client.js @@ -0,0 +1,36 @@ +let visible = false + +RegisterCommand('kasiraamat', (source, args) => { + print('Käsiraamat avatud.') + setDisplay(!visible) +}, false); + +RegisterNuiCallback("lahku",() => { + setDisplay(false) +}); + +RegisterNuiCallback("error",(data) => { + print(data.error) + setDisplay(false) +}); + +function setDisplay(b) { + visible = b + SetNuiFocus(b, b) + SendNUIMessage({ + type: "ui", + status: b + }); +} + +setImmediate(() => { + while (visible) { + Delay(0); + DisableControlAction(0, 1, visible) // LookLeftRight + DisableControlAction(0, 2, visible) // LookUpDown + DisableControlAction(0, 142, visible) // MeleeAttackAlternate + DisableControlAction(0, 18, visible) // Enter + DisableControlAction(0, 322, visible) // ESC + DisableControlAction(0, 106, visible) // VehicleMouseControlOverride + } +}) \ No newline at end of file diff --git a/fxmanifest.lua b/fxmanifest.lua new file mode 100644 index 0000000..7edc2b6 --- /dev/null +++ b/fxmanifest.lua @@ -0,0 +1,18 @@ +fx_version 'cerulean' +game 'gta5' + +name 'PDL Help' +author 'wallsxd & atluzka' +description 'Displays commands and keybind information' +version '1.0.1' + +client_scripts {"client/*.js"} + +ui_page { + 'html/index.html' +} + +files { + 'html/*.*', + 'html/images/*.*' +} diff --git a/html/images/logo.png b/html/images/logo.png new file mode 100644 index 0000000..828e473 Binary files /dev/null and b/html/images/logo.png differ diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..878a39a --- /dev/null +++ b/html/index.html @@ -0,0 +1,53 @@ + + + + + + + + + + + Käsiraamat + + +
+
+ logo +
+
+
+

NUPUD

+

Siin on kõik tavalised keybindid erinevatele tegevustele, mis teil vaja läheb

+
+
+

F1

+

Avab Telefoni

+
+
+

F2

+

Avab seljakoti

+
+ + +
+

COMMANDID

+

Siin on kõik tavalised keybindid erinevatele tegevustele, mis teil vaja läheb

+
+
+

/ABI

+

Avab selle sama menüü

+
+
+

/report

+

Loob kaebuse A-Tiimile

+
+ +
+
+ +
+
+ + + \ No newline at end of file diff --git a/html/script.js b/html/script.js new file mode 100644 index 0000000..fdd7b52 --- /dev/null +++ b/html/script.js @@ -0,0 +1,45 @@ +$(function () { + function display(bool) { + if (bool) { + $("#container").show(); + } else { + $("#container").hide(); + } + } + + display(false) + + window.addEventListener('message', function(event) { + var item = event.data; + if (item.type === "ui") { + if (item.status == true) { + display(true) + } else { + display(false) + } + } + }) + + document.onkeyup = function (data) { + if (data.key == "Escape") { + fetch(`https://${GetParentResourceName()}/lahku`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json; charset=UTF-8', + }, + body: JSON.stringify({}) + }).then(resp => resp.json()).then(resp => console.log(resp)); + return + } + }; + $("#close").click(function () { + fetch(`https://${GetParentResourceName()}/lahku`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json; charset=UTF-8', + }, + body: JSON.stringify({}) + }).then(resp => resp.json()).then(resp => console.log(resp)); + return + }) +}) \ No newline at end of file