├── fxmanifest.lua ├── config.lua ├── LICENSE.md ├── README.md └── client └── client.lua /fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | games { 'gta5' } 3 | 4 | -- 5 | -- Client 6 | -- 7 | 8 | client_scripts { 9 | 'config.lua', 10 | 11 | 'client/client.lua', 12 | } -------------------------------------------------------------------------------- /config.lua: -------------------------------------------------------------------------------- 1 | Config = {} 2 | 3 | -- 4 | -- Video shown on screen. Default is "CASINO_DIA_PL". 5 | -- 6 | -- CASINO_DIA_PL - Falling Diamonds 7 | -- CASINO_HLW_PL - Falling Skulls 8 | -- CASINO_SNWFLK_PL - Falling Snowflakes 9 | -- 10 | 11 | Config.VideoType = 'CASINO_DIA_PL' 12 | 13 | -- 14 | -- Enter & Exit Events 15 | -- 16 | -- These events should be fired by your teleport script when the player 17 | -- enters or exits the casino. 18 | -- 19 | 20 | Config.EnterEvent = 'chCasinoWall:enteredCasino' 21 | Config.ExitEvent = 'chCasinoWall:exitedCasino' 22 | 23 | -- 24 | -- Big Win Event 25 | -- 26 | -- Firing this event will cause the video walls to switch to the confetti 27 | -- animation before going back to the video type specified above. 28 | -- 29 | 30 | Config.BigWinEvent = 'chCasinoWall:bigWin' -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2021 CharlesHacks#9999 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # chCasinowall 2 | chCasinoWall enables the video walls inside the Diamond Casino & Resort, and adds an event that can be triggered to cause confetti to burst on the screens. 3 | 4 | ## Requirements 5 | 6 | * Game build 2060 or greater using `sv_enforceGameBuild 2060`. This resource has not been tested with, and is not guaranteed to work with, streamed casino interiors. 7 | * Some sort of teleport script that can fire events when the player enters and exits the casino. 8 | 9 | ## Configuration 10 | 11 | All configuration can be done in `config.lua`. 12 | 13 | |Field|Description|Default| 14 | |--|--|--| 15 | |`VideoType`|Default video wall animation. There are three options to choose from; diamonds, skulls, and snowflakes.|`CASINO_DIA_PL` _(Diamonds)_| 16 | |`EnterEvent`|This event must be fired when the player enters the casino to enable the video wall.|`chCasinoWall:enteredCasino`| 17 | |`ExitEvent`|This event must be fired when the player exits the casino.|`chCasinoWall:exitedCasino`| 18 | |`BigWinEvent`|Firing this event causes confetti to burst on the video screens before returning to the default animation.|`chCasinoWall:bigWin`| 19 | 20 | ## Usage 21 | 22 | Install and start the resource, ensure the `EnterEvent` is fired when you enter the casino, and you're pretty much done. Firing the `ExitEvent` as the player exits the casino is strongly encouraged for performance reasons. 23 | 24 | If you have any gambling scripts that could benefit from some extra excitement, fire the `BigWinEvent` and the player will see confetti bursting on the screens. 25 | 26 | ## Support 27 | 28 | Support is not offered for this resource. If you have discovered a bug, please open an issue on the Github repository with detailed reproduction steps and I will do my best to fix it. 29 | 30 | ## Contributing 31 | 32 | Pull requests are welcomed! Please be consistent with the existing code formatting and style, including 4 space indentation, TitleCase configuration values and camelCase function names, etc. 33 | 34 | ## Known Issues 35 | 36 | - The video sometimes stutters or restarts randomly. This is most likely due to how the video is stopped and started when entering/exiting the casino, and when playing the big win screen. PRs are welcome! 37 | 38 | ## License 39 | 40 | chCasinoWall is licensed under the MIT License. More details are available in [LICENSE.md](LICENSE.md). -------------------------------------------------------------------------------- /client/client.lua: -------------------------------------------------------------------------------- 1 | local inCasino = false 2 | local videoWallRenderTarget = nil 3 | local showBigWin = false 4 | 5 | -- 6 | -- Threads 7 | -- 8 | 9 | function startCasinoThreads() 10 | local interior = GetInteriorAtCoords(GetEntityCoords(GetPlayerPed(-1))) 11 | while not IsInteriorReady(interior) do Citizen.Wait(10) end 12 | RequestStreamedTextureDict('Prop_Screen_Vinewood') 13 | 14 | while not HasStreamedTextureDictLoaded('Prop_Screen_Vinewood') do 15 | Citizen.Wait(100) 16 | end 17 | 18 | RegisterNamedRendertarget('casinoscreen_01') 19 | 20 | LinkNamedRendertarget(`vw_vwint01_video_overlay`) 21 | 22 | videoWallRenderTarget = GetNamedRendertargetRenderId('casinoscreen_01') 23 | 24 | Citizen.CreateThread(function() 25 | local lastUpdatedTvChannel = 0 26 | 27 | while true do 28 | Citizen.Wait(0) 29 | 30 | if not inCasino then 31 | ReleaseNamedRendertarget('casinoscreen_01') 32 | 33 | videoWallRenderTarget = nil 34 | showBigWin = false 35 | 36 | break 37 | end 38 | 39 | if videoWallRenderTarget then 40 | local currentTime = GetGameTimer() 41 | 42 | if showBigWin then 43 | setVideoWallTvChannelWin() 44 | 45 | lastUpdatedTvChannel = GetGameTimer() - 33666 46 | showBigWin = false 47 | else 48 | if (currentTime - lastUpdatedTvChannel) >= 42666 then 49 | setVideoWallTvChannel() 50 | 51 | lastUpdatedTvChannel = currentTime 52 | end 53 | end 54 | 55 | SetTextRenderId(videoWallRenderTarget) 56 | SetScriptGfxDrawOrder(4) 57 | SetScriptGfxDrawBehindPausemenu(true) 58 | DrawInteractiveSprite('Prop_Screen_Vinewood', 'BG_Wall_Colour_4x4', 0.25, 0.5, 0.5, 1.0, 0.0, 255, 255, 255, 255) 59 | DrawTvChannel(0.5, 0.5, 1.0, 1.0, 0.0, 255, 255, 255, 255) 60 | SetTextRenderId(GetDefaultScriptRendertargetRenderId()) 61 | end 62 | end 63 | end) 64 | end 65 | 66 | -- 67 | -- Functions 68 | -- 69 | 70 | function setVideoWallTvChannel() 71 | SetTvChannelPlaylist(0, Config.VideoType, true) 72 | SetTvAudioFrontend(true) 73 | SetTvVolume(-100.0) 74 | SetTvChannel(0) 75 | end 76 | 77 | function setVideoWallTvChannelWin() 78 | SetTvChannelPlaylist(0, 'CASINO_WIN_PL', true) 79 | SetTvAudioFrontend(true) 80 | SetTvVolume(-100.0) 81 | SetTvChannel(-1) 82 | SetTvChannel(0) 83 | end 84 | 85 | -- 86 | -- Events 87 | -- 88 | 89 | AddEventHandler(Config.EnterEvent, function() 90 | inCasino = true 91 | 92 | startCasinoThreads() 93 | end) 94 | 95 | AddEventHandler(Config.ExitEvent, function() 96 | inCasino = false 97 | end) 98 | 99 | AddEventHandler(Config.BigWinEvent, function() 100 | if not inCasino then 101 | return 102 | end 103 | 104 | showBigWin = true 105 | end) 106 | --------------------------------------------------------------------------------