Does anyone know how to make this CAD or does anyone know a resource like this?
Picture:
What I want is a Tablet with a Google Sheets Document that is Synced for the whole Server and it can only be opened by someone with the Policejob (im using ESX)
Would be nice if someone can help me thx!
1 Like
That’s not a resource, it’s an actual google sheet document being embedded in html with iframe probably
Do you know how I can get this or make this? @MojitoBurrito
@Wolkenklar
Seems pretty straight forward.
- Copy the format/layout/design that they have created (the layout, colours, text etc)
- Create a NUI and embed an iframe element pointing to your excel file’s URL (they are using Google Sheets)
- Display your newly created NUI in-game which will automatically display your iframe element showing your CAD.
I don´t know how I can make this work but im gona look up some tutorials
thx
Also I don´t know how I can make it so only people with the police and admin job can open it
And now it is not working anymore wow
fxmanifest.lua (239 Bytes)
main.lua (601 Bytes)
index.html (503 Bytes)
script.js (747 Bytes)
style.css (137 Bytes)
I now have made it and it is working but only with an key to open I want it to be with a command can you help me?
local showUi = false
Citizen.CreateThread(function()
Citizen.Wait(1)
while true do
if IsControlJustReleased(0, 288) then
if showUi == false then
SetNuiFocus(true, true)
SendNUIMessage({type = "enable"})
showUi = true;
end
end
Citizen.Wait(1)
end
end)
RegisterNUICallback('NUIFocusOff', function()
if showUi == true then
SetNuiFocus(false, false)
SendNUIMessage({type = "disable"})
showUi = false
end
end)
RegisterCommand("pcad", function(source, args, rawCommand)
if source > 0 then
if showUi == false then
SetNuiFocus(true, true)
SendNUIMessage({type = "enable"})
showUi = true;
else
print("You can not open this CAD in the console!")
end
end)
very easy just detect if message sent from player to chat with /tablet or something else.
@Wolkenklar
Of course.
- Remove the following thread/loop:
Citizen.CreateThread(function()
Citizen.Wait(1)
while true do
if IsControlJustReleased(0, 288) then
if showUi == false then
SetNuiFocus(true, true)
SendNUIMessage({type = "enable"})
showUi = true;
end
end
Citizen.Wait(1)
end
end)
- Replace the
pcad
command with the following:
RegisterCommand("pcad", function()
if showUi == false then
SetNuiFocus(true, true)
SendNUIMessage({type = "enable"})
showUi = true;
else
print("You can not open this CAD in the console!")
end
end, false)
It says that there is no command named pcad
This is my code in the main.lua
local showUi = false
RegisterNUICallback('NUIFocusOff', function()
if showUi == true then
SetNuiFocus(false, false)
SendNUIMessage({type = "disable"})
showUi = false
end
end)
RegisterCommand("pcad", function()
if showUi == false then
SetNuiFocus(true, true)
SendNUIMessage({type = "enable"})
showUi = true;
else
print("You can not open this CAD in the console!")
end
end)
@Wolkenklar
How about this?
RegisterCommand("pcad", function()
if showUi == false then
SetNuiFocus(true, true)
SendNUIMessage({type = "enable"})
showUi = true;
else
print("You can not open this CAD in the console!")
end
end, false)
1 Like
it is working now tysm (I wasnt at home the last week so I coudn´t respond sry)
3 Likes
Could you send me the Sheet if you have it. Would be great! (Bin auch deutsch)