├── README.md ├── client ├── main.lua └── zones.lua ├── fxmanifest.lua ├── html ├── app.js ├── index.html └── style.css └── server └── main.lua /README.md: -------------------------------------------------------------------------------- 1 | # Screens Script 2 | With this script the opportunities are endless. You can create as many screens as you want with a single script. 3 | 4 | ## Description 5 | 6 | - This particular script lets you create as many dui screens you want with 4 simple steps 7 | - Steps 8 | - Create a ox lib polyzone around the room where the screen is present. 9 | - Create a target boxzone for the screen to target on. 10 | - Go to the maps folder, look for the texture dictionary and texture name of the screen you want to use 11 | - Add all the information in client/zones.lua as I have done in the example 12 | 13 | ## Dependencies 14 | 15 | - ox_lib 16 | - qb-target/qtarget/ox_target 17 | 18 | ## Installation 19 | - Download the script and put it in your resources folder 20 | - Make sure the script is named `dui`. If its named `dui-main` or `dui-anything`, rename it to `dui` 21 | - Add `ensure dui` to your server.cfg 22 | - Make sure you have the dependencies installed 23 | - You are good to go!! 24 | 25 | ## Support 26 | 27 | - Discord: https://discord.gg/VGYkkAYVv2 28 | - Website : https://snipe.tebex.io 29 | - If you have a custom mlo and have a screen in there which you want to use with this script, make sure you make the polyzones and target before you ask in my discord on how to find texture dictionary and texture name. I can only help with the texture dictionaries and texture name if you do the other steps first. -------------------------------------------------------------------------------- /client/main.lua: -------------------------------------------------------------------------------- 1 | -----------------For support, scripts, and more---------------- 2 | --------------- https://discord.gg/VGYkkAYVv2 ------------- 3 | --------------------------------------------------------------- 4 | 5 | local duiObj = {} 6 | local currentRoom = nil 7 | local currentDUIInfo = nil 8 | local multiScreens = false 9 | local currentName = nil 10 | 11 | local function onEnter(self) 12 | currentRoom = self.name 13 | multiScreens = self.multiScreens 14 | local response = lib.callback.await("dui:server:getCurrentDUI", false, currentRoom) 15 | if not self.multiScreens then 16 | 17 | if response and next(response) then 18 | local duiInfo = response.duiInfo 19 | local url = response.url 20 | local width = response.width 21 | local height = response.height 22 | local txd = CreateRuntimeTxd(currentRoom.."_txd") 23 | duiObj[currentRoom] = CreateDui(url, width, height) 24 | local dui = GetDuiHandle(duiObj[currentRoom]) 25 | local duiTexture = GetDuiHandle(duiObj[currentRoom]) 26 | local duiTexture = CreateRuntimeTextureFromDuiHandle(txd, duiInfo.textName, dui) 27 | AddReplaceTexture(duiInfo.textDict, duiInfo.textName, currentRoom.."_txd", duiInfo.textName) 28 | end 29 | else 30 | Wait(100) 31 | if response and next(response) then 32 | if not duiObj[currentRoom] then 33 | duiObj[currentRoom] = {} 34 | end 35 | for k, v in pairs(response) do 36 | 37 | local duiInfo = v.duiInfo 38 | local url = v.url 39 | local width = v.width 40 | local height = v.height 41 | local txd = CreateRuntimeTxd(k.."_txd") 42 | duiObj[currentRoom][k] = CreateDui(url, width, height) 43 | local dui = GetDuiHandle(duiObj[currentRoom][k]) 44 | local duiTexture = GetDuiHandle(duiObj[currentRoom][k]) 45 | local duiTexture = CreateRuntimeTextureFromDuiHandle(txd, duiInfo.textName, dui) 46 | AddReplaceTexture(duiInfo.textDict, duiInfo.textName, k.."_txd", duiInfo.textName) 47 | end 48 | end 49 | end 50 | end 51 | local function onExit(self) 52 | if not multiScreens then 53 | if duiObj[self.name] then 54 | DestroyDui(duiObj[self.name]) 55 | end 56 | duiObj[self.name] = nil 57 | RemoveReplaceTexture(DUIZones[self.name].duiInfo.textDict, DUIZones[self.name].duiInfo.textName) 58 | currentRoom = nil 59 | currentName = nil 60 | multiScreens = false 61 | else 62 | if duiObj[self.name] then 63 | for k, v in pairs(duiObj[self.name]) do 64 | DestroyDui(v) 65 | end 66 | duiObj[self.name] = nil 67 | -- RemoveReplaceTexture(DUIZones[self.name].duiInfo.textDict, DUIZones[self.name].duiInfo.textName) 68 | for k, v in pairs(DUIZones[self.name].dui) do 69 | RemoveReplaceTexture(v.duiInfo.textDict, v.duiInfo.textName) 70 | end 71 | currentRoom = nil 72 | currentName = nil 73 | multiScreens = false 74 | end 75 | end 76 | end 77 | 78 | CreateThread(function() 79 | for k, v in pairs(DUIZones) do 80 | if v.enabled then 81 | if v.duiInfo then 82 | v.zone.onEnter = onEnter 83 | v.zone.onExit = onExit 84 | lib.zones.poly(v.zone) 85 | 86 | local name = v.zone.name 87 | local duiInfo = v.duiInfo 88 | exports["qb-target"]:AddBoxZone(v.zone.name, v.target.coords, v.target.length, v.target.width, { 89 | name=v.zone.name, 90 | heading=v.target.heading, 91 | debugPoly = false, 92 | minZ=v.target.minZ, 93 | maxZ=v.target.maxZ 94 | },{ 95 | options = { 96 | { 97 | action = function() 98 | changeImage(name, duiInfo) 99 | end, 100 | icon = "fas fa-laptop", 101 | label = "Change Image", 102 | job = v.job or "none" 103 | }, 104 | { 105 | action = function() 106 | removeImage(name) 107 | end, 108 | icon = "fas fa-laptop", 109 | label = "Remove Image", 110 | job = v.job or "none" 111 | }, 112 | }, 113 | distance = 2.5 114 | }) 115 | else 116 | if v.dui then 117 | v.zone.onEnter = onEnter 118 | v.zone.onExit = onExit 119 | v.zone.multiScreens = true 120 | lib.zones.poly(v.zone) 121 | 122 | for index, data in pairs(v.dui) do 123 | local name = index 124 | local duiInfo = data.duiInfo 125 | exports["qb-target"]:AddBoxZone(v.zone.name.."_"..name, data.target.coords, data.target.length, data.target.width, { 126 | name=v.zone.name.."_"..name, 127 | heading=data.target.heading, 128 | debugPoly = false, 129 | minZ=data.target.minZ, 130 | maxZ=data.target.maxZ 131 | },{ 132 | options = { 133 | { 134 | action = function() 135 | changeImage(v.zone.name.."_"..name, data.duiInfo) 136 | end, 137 | icon = "fas fa-laptop", 138 | label = "Change Image", 139 | job = v.job or "all" 140 | }, 141 | { 142 | action = function() 143 | removeImage(v.zone.name.."_"..name) 144 | end, 145 | icon = "fas fa-laptop", 146 | label = "Remove Image", 147 | job = v.job or "all" 148 | }, 149 | }, 150 | distance = 2.5 151 | }) 152 | end 153 | end 154 | end 155 | end 156 | end 157 | end) 158 | 159 | function changeImage(name, duiInfo) 160 | currentDUIInfo = duiInfo 161 | if multiScreens then 162 | currentName = name 163 | end 164 | SendNUIMessage({ 165 | action = "start" 166 | }) 167 | SetNuiFocus(true, true) 168 | end 169 | 170 | function removeImage(name) 171 | if multiScreens then 172 | currentName = name 173 | end 174 | TriggerServerEvent("dui:server:removeImage", currentRoom, currentName) 175 | end 176 | 177 | RegisterNetEvent("dui:client:removeImage", function(room, duiInfo, name) 178 | if currentRoom == nil then 179 | return 180 | end 181 | if currentRoom ~= room then 182 | return 183 | end 184 | if name then 185 | if duiObj[room] then 186 | if duiObj[room][name] then 187 | DestroyDui(duiObj[room][name]) 188 | duiObj[room][name] = nil 189 | end 190 | end 191 | else 192 | if duiObj[room] then 193 | DestroyDui(duiObj[room]) 194 | duiObj[room] = nil 195 | end 196 | end 197 | RemoveReplaceTexture(duiInfo.textDict, duiInfo.textName) 198 | -- RemoveReplaceTexture(DUIZones[name].duiInfo.textDict, DUIZones[name].duiInfo.textName) 199 | end) 200 | 201 | 202 | RegisterNUICallback('CloseDocument', function() 203 | SetNuiFocus(false, false) 204 | end) 205 | 206 | RegisterNUICallback('Invalid', function() 207 | SetNuiFocus(false, false) 208 | lib.notify({description = "Invalid URL", type = "error"}) 209 | end) 210 | 211 | RegisterNUICallback('PrintDocument', function(data) 212 | SetNuiFocus(false, false) 213 | local url = data.url 214 | local width = data.width 215 | local height = data.height 216 | 217 | 218 | if duiObj[currentRoom] and not multiScreens then 219 | DestroyDui(duiObj[currentRoom]) 220 | duiObj[currentRoom] = nil 221 | else 222 | if duiObj[currentRoom] and duiObj[currentRoom][currentName] then 223 | DestroyDui(duiObj[currentRoom][currentName]) 224 | duiObj[currentRoom][currentName] = nil 225 | end 226 | end 227 | RemoveReplaceTexture(currentDUIInfo.textDict, currentDUIInfo.textName) 228 | 229 | TriggerServerEvent("dui:server:changeImage", currentRoom, url, width, height, currentDUIInfo, currentName) 230 | 231 | currentDUIInfo = nil 232 | currentName = nil 233 | end) 234 | 235 | RegisterNetEvent("dui:client:syncTextures", function(room, url, width, height, duiInfo, name) 236 | if currentRoom == nil then 237 | return 238 | end 239 | if currentRoom ~= room then 240 | return 241 | end 242 | 243 | if duiObj[room] and not multiScreens then 244 | DestroyDui(duiObj[room]) 245 | RemoveReplaceTexture(duiInfo.textDict, duiInfo.textName) 246 | duiObj[room] = nil 247 | else 248 | if duiObj[room] and duiObj[room][name] then 249 | DestroyDui(duiObj[room][name]) 250 | RemoveReplaceTexture(duiInfo.textDict, duiInfo.textName) 251 | duiObj[room][name] = nil 252 | end 253 | end 254 | if not multiScreens then 255 | local txd = CreateRuntimeTxd(currentRoom.."_txd") 256 | duiObj[currentRoom] = CreateDui(url, width, height) 257 | local dui = GetDuiHandle(duiObj[currentRoom]) 258 | local tx = CreateRuntimeTextureFromDuiHandle(txd, "doc_png", dui) 259 | AddReplaceTexture(duiInfo.textDict, duiInfo.textName, currentRoom.."_txd", "doc_png") 260 | else 261 | local txd = CreateRuntimeTxd(name.."_txd") 262 | if not duiObj[currentRoom] then 263 | duiObj[currentRoom] = {} 264 | end 265 | duiObj[currentRoom][name] = CreateDui(url, width, height) 266 | local dui = GetDuiHandle(duiObj[currentRoom][name]) 267 | local tx = CreateRuntimeTextureFromDuiHandle(txd, "doc_png", dui) 268 | AddReplaceTexture(duiInfo.textDict, duiInfo.textName, name.."_txd", "doc_png") 269 | end 270 | end) 271 | 272 | AddEventHandler("onResourceStop", function() 273 | if GetCurrentResourceName() ~= "dui" then 274 | return 275 | end 276 | for k, v in pairs(duiObj) do 277 | 278 | if type(v) == "number" then 279 | DestroyDui(v) 280 | duiObj[k] = nil 281 | else 282 | for _, data in pairs(v) do 283 | DestroyDui(data) 284 | end 285 | duiObj[k] = nil 286 | end 287 | end 288 | for k, v in pairs(DUIZones) do 289 | if v.duiInfo then 290 | RemoveReplaceTexture(v.duiInfo.textDict, v.duiInfo.textName) 291 | end 292 | if v.dui then 293 | for k, v in pairs(v.dui) do 294 | RemoveReplaceTexture(v.duiInfo.textDict, v.duiInfo.textName) 295 | end 296 | end 297 | end 298 | end) 299 | -------------------------------------------------------------------------------- /client/zones.lua: -------------------------------------------------------------------------------- 1 | -----------------For support, scripts, and more---------------- 2 | --------------- https://discord.gg/VGYkkAYVv2 ------------- 3 | --------------------------------------------------------------- 4 | 5 | DUIZones = { 6 | 7 | -- mrpd dui's 8 | ["mrpd_room_1_classroom_projector"] = { 9 | enabled = true, -- set to false to disable this screen 10 | zone = { 11 | name = "mrpd_room_1_classroom_projector", 12 | points = { 13 | vec3(454.45001220703, -989.0, 35.0), 14 | vec3(456.5, -991.0, 35.0), 15 | vec3(462.25, -991.0, 35.0), 16 | vec3(464.25, -989.25, 35.0), 17 | vec3(464.25, -982.75, 35.0), 18 | vec3(462.38000488281, -981.14001464844, 35.0), 19 | vec3(456.5, -981.16998291016, 35.0), 20 | vec3(454.66000366211, -982.80999755859, 35.0), 21 | }, 22 | thickness = 4.0, 23 | debug = false, 24 | }, 25 | duiInfo = { 26 | textDict = "gabz_mm_screen", 27 | textName = "script_rt_big_disp", 28 | }, 29 | target = { 30 | coords = vector3(455.02, -985.87, 34.97), 31 | length = 0.2, 32 | width = 3.0, 33 | heading = 270.0, 34 | minZ=35.12, 35 | maxZ=37.12 36 | }, 37 | job = "police", 38 | }, 39 | ["mrpd_room_1_projector"] = { 40 | enabled = true, -- set to false to disable this screen 41 | zone = { 42 | name = "mrpd_room_1_projector", 43 | points = { 44 | vec3(450.80999755859, -982.91998291016, 35.0), 45 | vec3(448.5, -980.67999267578, 35.0), 46 | vec3(438.70999145508, -981.02001953125, 35.0), 47 | vec3(439.42999267578, -990.77001953125, 35.0), 48 | vec3(448.29000854492, -990.95001220703, 35.0), 49 | vec3(450.17001342773, -990.44000244141, 35.0), 50 | }, 51 | thickness = 4.0, 52 | debug = false, 53 | }, 54 | duiInfo = { 55 | textDict = "prop_planning_b1", 56 | textName = "prop_base_white_01b", 57 | }, 58 | target = { 59 | coords = vector3(439.44, -985.89, 34.97), 60 | length = 2.6, 61 | width = 0.4, 62 | heading = 0.0, 63 | minZ=35.22, 64 | maxZ=36.62 65 | }, 66 | job = "police", 67 | }, 68 | ["weaslePD"] = { -- https://www.youtube.com/watch?v=QLZapqdB9JM (Thanks to Techmanmurphy) 69 | enabled = false, -- set to false to disable this screen 70 | zone = { 71 | name = "weaslePD", -- https://nxp.tebex.io/package/4896304 72 | points = { 73 | vec3(-569.85546875, -922.92956542969, 23.0), 74 | vec3(-570.10565185547, -933.77026367188, 23.0), 75 | vec3(-572.38610839844, -936.06976318359, 23.0), 76 | vec3(-572.38757324219, -939.62341308594, 23.0), 77 | vec3(-560.17053222656, -940.19738769531, 23.0), 78 | vec3(-561.13952636719, -923.23004150391, 23.0) 79 | }, 80 | thickness = 4.0, 81 | debug = false, 82 | }, 83 | duiInfo = { 84 | textDict = "v_ilev_mm_screen", -- prop name if embeded 85 | textName = "script_rt_big_disp", -- 86 | }, 87 | target = { 88 | coords = vector3(-565.50524902344, -923.41802978516, 24.920973968506), 89 | length = 2.6, 90 | width = 0.5, 91 | heading = 0.0, 92 | minZ=23.22, 93 | maxZ=25.62, 94 | }, 95 | job = "police", 96 | }, 97 | ["np_townhall_big_screen"] = { -- Shwntv 98 | enabled = false, -- set to false to disable this screen 99 | zone = { 100 | name = "np_townhall_big_screen", -- https://3dstore.nopixel.net/ 101 | points = { 102 | vec3(-527.98, -193.77, 38.0), 103 | vec3(-538.59, -175.02, 38.0), 104 | vec3(-521.14, -164.91, 38.0), 105 | vec3(-510.68, -182.38, 38.0), 106 | }, 107 | thickness = 15.0, 108 | debug = false, 109 | }, 110 | duiInfo = { 111 | textDict = "np_town_hall_bigscreen", 112 | textName = "projector_screen", 113 | }, 114 | target = { 115 | coords = vector3(-518.368286, -176.852142, 38.45), 116 | length = 1.0, 117 | width = 1.0, 118 | heading = 270.0, 119 | minZ=37.12, 120 | maxZ=37.45 121 | }, 122 | job = "doj", 123 | }, 124 | ["pizzeria"] = { -- Gabz Pizzeria 125 | enabled = false, 126 | zone = { 127 | name = "pizzeria", 128 | points = { 129 | vector3(792.4, -769.0, 26.45), 130 | vector3(793.29, -746.39, 26.45), 131 | vector3(816.16, -746.89, 26.45), 132 | vector3(815.57, -770.02, 26.45), 133 | }, 134 | thickness = 4.0, 135 | debug = true, 136 | }, 137 | dui = { 138 | ["pizzeria_menu"] = { 139 | ["duiInfo"] = { 140 | textDict = "sm_pizzeria_txd_02", -- prop name if embeded 141 | textName = "pizzeria_menu", 142 | }, 143 | target = { 144 | coords = vector3(814.27, -754.99, 26.78), 145 | length = 1.4, 146 | width = 1, 147 | heading = 0.0, 148 | minZ=27.58, 149 | maxZ=28.98 150 | }, 151 | }, 152 | ["pizzeria-logo"] = { 153 | duiInfo = { 154 | textDict = "sm_pizzeria_txd_01", -- prop name if embeded 155 | textName = "maldini-logo", -- 156 | }, 157 | target = { 158 | coords = vector3(813.68, -752.89, 26.78), 159 | length = 1.4, 160 | width = 0.4, 161 | heading = 5.0, 162 | minZ=28.13, 163 | maxZ=29.33 164 | }, 165 | }, 166 | ["pizzeria-drinks"] = { 167 | duiInfo = { 168 | textDict = "sm_pizzeria_txd_02", -- prop name if embeded 169 | textName = "pizzeria_dinks", -- 170 | }, 171 | target = { 172 | coords = vector3(814.13, -751.12, 26.78), 173 | length = 1, 174 | width = 1, 175 | heading = 0.0, 176 | minZ=28.38, 177 | maxZ=29.78 178 | }, 179 | } 180 | }, 181 | }, 182 | } 183 | -------------------------------------------------------------------------------- /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | -----------------For support, scripts, and more---------------- 2 | --------------- https://discord.gg/VGYkkAYVv2 ------------- 3 | --------------------------------------------------------------- 4 | 5 | fx_version 'cerulean' 6 | game 'gta5' 7 | lua54 'yes' 8 | 9 | description "DUI system for FiveM" 10 | author "Snipe" 11 | version '1.0.0' 12 | 13 | ui_page "html/index.html" 14 | 15 | shared_scripts{ 16 | '@ox_lib/init.lua', 17 | } 18 | 19 | client_scripts { 20 | 'client/**/*.lua', 21 | } 22 | 23 | server_scripts { 24 | 'server/**/*.lua' 25 | } 26 | 27 | files { 28 | '*.lua', 29 | 'html/*.html', 30 | 'html/*.js', 31 | 'html/*.css', 32 | 'html/*.png', 33 | } 34 | -------------------------------------------------------------------------------- /html/app.js: -------------------------------------------------------------------------------- 1 | UI = {} 2 | 3 | $(document).ready(function () { 4 | window.addEventListener('message', function (event) { 5 | var action = event.data.action; 6 | 7 | switch (action) { 8 | case "start": 9 | UI.Start(event.data); 10 | break; 11 | case "close": 12 | UI.Close(event.data); 13 | break; 14 | } 15 | }); 16 | }); 17 | 18 | $(document).on('keydown', function () { 19 | switch (event.keyCode) { 20 | case 27: // ESC 21 | UI.Close(); 22 | break; 23 | } 24 | }); 25 | 26 | UI.Start = function (data) { 27 | $("#fileurl").val("") 28 | $(".printer-container").fadeIn(150); 29 | $(".printer-wrapper").css("display", "grid"); 30 | } 31 | 32 | UI.Close = function (data) { 33 | $(".document-container").fadeOut(150); 34 | $(".printer-container").fadeOut(150); 35 | $.post('https://dui/CloseDocument'); 36 | } 37 | 38 | function isValidHttpUrl(string) { 39 | let url; 40 | 41 | try { 42 | url = new URL(string); 43 | } catch (_) { 44 | return false; 45 | } 46 | 47 | return url.protocol === "http:" || url.protocol === "https:"; 48 | } 49 | 50 | function getMeta(url) { 51 | return new Promise((resolve, reject) => { 52 | let img = new Image(); 53 | // console.log(img) 54 | img.onload = () => resolve(img); 55 | img.onerror = () => reject(); 56 | img.src = url; 57 | }); 58 | } 59 | 60 | async function run(url) { 61 | let img 62 | try { 63 | img = await getMeta(url); 64 | } 65 | catch (e) { 66 | return { width: 1920, height: 1080 } 67 | } 68 | let w = img.width; 69 | let h = img.height; 70 | return { width: w, height: h } 71 | } 72 | 73 | UI.Print = async function (data) { 74 | $(".document-container").fadeOut(150); 75 | $(".printer-container").fadeOut(150); 76 | if ($("#fileurl").val()) { 77 | if (isValidHttpUrl($("#fileurl").val())) { 78 | var end = await run($("#fileurl").val()); 79 | var w = end.width; 80 | var h = end.height; 81 | $.post('https://dui/PrintDocument', JSON.stringify({ 82 | url: $("#fileurl").val(), 83 | width: w, 84 | height: h 85 | })); 86 | } 87 | else { 88 | $.post('https://dui/Invalid'); 89 | } 90 | } else { 91 | $.post('https://dui/Invalid'); 92 | } 93 | } 94 | 95 | -------------------------------------------------------------------------------- /html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | MRPD screens 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 | 20 |
21 | 22 | 23 |
24 |
25 |
26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /html/style.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700&display=swap'); 2 | 3 | :root { 4 | --bg-secondary: #020610; 5 | --bg-red: #ef4444; 6 | --bg-tertiary: rgba(255, 255, 255, 0.082); 7 | --border-secondary: rgba(77, 75, 89, 0.8); 8 | --text-primary: #ffffff; 9 | --brand-blue: #020610; 10 | --accent: #22c55e; 11 | --gradient-blue: radial-gradient(circle, #3b82f6, #347af4, #2e73f1, #296bee, #2563eb); 12 | 13 | --green-gradient: linear-gradient(180deg, rgba(34,197,94,1) 0%, rgba(22,163,74,1) 100%); 14 | --red-gradient: linear-gradient(180deg, rgba(239,68,68,1) 0%, rgba(209,51,51,1) 100%); 15 | } 16 | 17 | * { 18 | margin: 0; 19 | padding: 0; 20 | box-sizing: border-box; 21 | font-family: 'Cairo', sans-serif; 22 | } 23 | 24 | *::selection { 25 | background: var(--brand-blue); 26 | color: var(--text-primary); 27 | } 28 | 29 | html { 30 | -webkit-font-smoothing: antialiased; 31 | scroll-behavior: smooth; 32 | } 33 | 34 | .printer-wrapper { 35 | height: 100vh; 36 | width: 100vw; 37 | overflow: hidden; 38 | line-height: 1.6vh; 39 | display: none; 40 | place-items: center; 41 | } 42 | 43 | .printer-container { 44 | display: none; 45 | width: 30vh; 46 | height: 14vh; 47 | background-color: var(--bg-secondary); 48 | border-radius: 1vh; 49 | display: flex; 50 | justify-content: center; 51 | align-items: center; 52 | flex-direction: column; 53 | border: 0.2vh solid var(--border-secondary); 54 | -webkit-box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.64); 55 | -moz-box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.64); 56 | box-shadow: 0px 0px 12px 0px rgba(0,0,0,0.64); 57 | 58 | } 59 | 60 | .printer-input { 61 | display: block; 62 | text-decoration: none; 63 | background: transparent; 64 | color: var(--text-primary); 65 | outline: none; 66 | border: none; 67 | text-align: center; 68 | font-size: 1.4vh; 69 | transition: 0.2s ease-in-out; 70 | background: var(--bg-tertiary); 71 | border-radius: 0.4vh; 72 | padding: 0.4vh 0.6vh; 73 | letter-spacing: 0.06vh; 74 | width: 85%; 75 | margin-bottom: 1.4vh; 76 | } 77 | 78 | .btn-wrapper { 79 | display: flex; 80 | align-items: center; 81 | justify-content: center; 82 | width: 100%; 83 | } 84 | 85 | .closebtn, 86 | .printbtn { 87 | background: var(--red-gradient); 88 | background-repeat: no-repeat; 89 | font-weight: 600; 90 | border: none; 91 | cursor: pointer; 92 | overflow: hidden; 93 | outline: none; 94 | text-align: center; 95 | text-decoration: none; 96 | color: var(--text-primary); 97 | font-size: 1.4vh; 98 | border-radius: 10vh; 99 | cursor: pointer; 100 | padding: 0.4vh 0; 101 | width: 8vh; 102 | letter-spacing: 0.04vh; 103 | } 104 | 105 | .printbtn { 106 | margin-left: 2vh; 107 | background: var(--green-gradient); 108 | } -------------------------------------------------------------------------------- /server/main.lua: -------------------------------------------------------------------------------- 1 | -----------------For support, scripts, and more---------------- 2 | --------------- https://discord.gg/VGYkkAYVv2 ------------- 3 | --------------------------------------------------------------- 4 | 5 | local duiInfo = {} 6 | 7 | RegisterServerEvent("dui:server:changeImage", function(currentRoom, url, width, height, currentDUIInfo, name) 8 | if not name then 9 | duiInfo[currentRoom] = { 10 | url = url, 11 | width = width, 12 | height = height, 13 | duiInfo = currentDUIInfo 14 | } 15 | else 16 | if not duiInfo[currentRoom] then 17 | duiInfo[currentRoom] = {} 18 | end 19 | duiInfo[currentRoom][name] = { 20 | url = url, 21 | width = width, 22 | height = height, 23 | duiInfo = currentDUIInfo 24 | } 25 | end 26 | TriggerClientEvent("dui:client:syncTextures", -1, currentRoom, url, width, height, currentDUIInfo, name) 27 | end) 28 | 29 | RegisterServerEvent("dui:server:removeImage", function(currentRoom, name) 30 | local sendDUIInfo = nil 31 | if name then 32 | if duiInfo[currentRoom] then 33 | sendDUIInfo = duiInfo[currentRoom][name] 34 | duiInfo[currentRoom][name] = nil 35 | end 36 | else 37 | sendDUIInfo = duiInfo[currentRoom] 38 | 39 | duiInfo[currentRoom] = nil 40 | end 41 | duiInfo[currentRoom] = nil 42 | TriggerClientEvent("dui:client:removeImage", -1, currentRoom, sendDUIInfo.duiInfo, name) 43 | end) 44 | 45 | lib.callback.register("dui:server:getCurrentDUI", function(source, currentRoom) 46 | return duiInfo[currentRoom] 47 | end) --------------------------------------------------------------------------------