├── .gitattributes
├── map
├── __resource.lua
└── stream
│ ├── generic_texture_renderer.gfx
│ └── generic_texture_renderer_2.gfx
├── README.md
├── FiveM_Client
├── Properties
│ └── AssemblyInfo.cs
├── FiveM_Client.csproj
├── NativeUI
│ └── Sprite.cs
└── FiveM_Plugin
│ ├── VideoPlayer.cs
│ └── FXClient.cs
├── FiveM_Server
├── Properties
│ └── AssemblyInfo.cs
├── FiveM_Server.csproj
└── FXServer.cs
└── FXPlugin.sln
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/map/__resource.lua:
--------------------------------------------------------------------------------
1 | resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
2 |
--------------------------------------------------------------------------------
/map/stream/generic_texture_renderer.gfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sheenthebest/fivem_cinema/HEAD/map/stream/generic_texture_renderer.gfx
--------------------------------------------------------------------------------
/map/stream/generic_texture_renderer_2.gfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sheenthebest/fivem_cinema/HEAD/map/stream/generic_texture_renderer_2.gfx
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # fivem_cinema
2 |
3 | https://forum.fivem.net/t/cinema-with-working-youtube-and-distanced-sound-volume-preview-wip-c/150737/13
4 |
5 | C# - Only Source Code
6 |
7 | This code probably do not work if you are not a developer.
8 |
9 | No Support
10 |
--------------------------------------------------------------------------------
/FiveM_Client/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Reflection;
4 | using System.Runtime.CompilerServices;
5 | using System.Runtime.InteropServices;
6 | using System.Runtime.Versioning;
7 |
8 | [assembly: AssemblyVersion("1.0.0.0")]
9 | [assembly: CompilationRelaxations(8)]
10 | [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
11 | [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
12 | [assembly: AssemblyTitle("FiveM_Plugin")]
13 | [assembly: AssemblyDescription("")]
14 | [assembly: AssemblyConfiguration("")]
15 | [assembly: AssemblyCompany("")]
16 | [assembly: AssemblyProduct("FiveM_Plugin")]
17 | [assembly: AssemblyCopyright("Copyright © 2018")]
18 | [assembly: AssemblyTrademark("")]
19 | [assembly: ComVisible(false)]
20 | [assembly: Guid("01188858-d24b-4da2-9c48-2609811568d2")]
21 | [assembly: AssemblyFileVersion("1.0.0.0")]
22 |
--------------------------------------------------------------------------------
/FiveM_Server/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Reflection;
4 | using System.Runtime.CompilerServices;
5 | using System.Runtime.InteropServices;
6 | using System.Runtime.Versioning;
7 |
8 | [assembly: AssemblyVersion("1.0.0.0")]
9 | [assembly: CompilationRelaxations(8)]
10 | [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
11 | [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
12 | [assembly: AssemblyTitle("FiveM_Server")]
13 | [assembly: AssemblyDescription("")]
14 | [assembly: AssemblyConfiguration("")]
15 | [assembly: AssemblyCompany("")]
16 | [assembly: AssemblyProduct("FiveM_Server")]
17 | [assembly: AssemblyCopyright("Copyright © 2018")]
18 | [assembly: AssemblyTrademark("")]
19 | [assembly: ComVisible(false)]
20 | [assembly: Guid("17d71ace-b4fb-4389-b0f0-59210d0790ec")]
21 | [assembly: AssemblyFileVersion("1.0.0.0")]
22 |
--------------------------------------------------------------------------------
/FXPlugin.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26228.4
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FiveM_Client", "FiveM_Client\FiveM_Client.csproj", "{30F488B6-04D2-4C03-963E-C285349903CF}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FiveM_Server", "FiveM_Server\FiveM_Server.csproj", "{30F488B6-04D2-4C03-963E-C285349903D0}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {30F488B6-04D2-4C03-963E-C285349903CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {30F488B6-04D2-4C03-963E-C285349903CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {30F488B6-04D2-4C03-963E-C285349903CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {30F488B6-04D2-4C03-963E-C285349903CF}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {30F488B6-04D2-4C03-963E-C285349903D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {30F488B6-04D2-4C03-963E-C285349903D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {30F488B6-04D2-4C03-963E-C285349903D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {30F488B6-04D2-4C03-963E-C285349903D0}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/FiveM_Server/FiveM_Server.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {30F488B6-04D2-4C03-963E-C285349903D0}
8 | Library
9 | FiveM_Server
10 | FiveM_Server
11 | v4.5.2
12 | 512
13 |
14 |
15 | AnyCPU
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | AnyCPU
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/FiveM_Client/FiveM_Client.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {30F488B6-04D2-4C03-963E-C285349903CF}
8 | Library
9 | FiveM_Client
10 | FiveM_Client
11 | v4.5.2
12 | 512
13 |
14 |
15 | AnyCPU
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | AnyCPU
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/FiveM_Client/NativeUI/Sprite.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.IO;
4 | using System.Reflection;
5 | using CitizenFX.Core.Native;
6 | using CitizenFX.Core.UI;
7 |
8 | namespace NativeUI
9 | {
10 | // Token: 0x02000002 RID: 2
11 | public class Sprite
12 | {
13 | // Token: 0x17000001 RID: 1
14 | // (get) Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
15 | // (set) Token: 0x06000002 RID: 2 RVA: 0x00002058 File Offset: 0x00000258
16 | public string TextureDict
17 | {
18 | get
19 | {
20 | return this._textureDict;
21 | }
22 | set
23 | {
24 | this._textureDict = value;
25 | }
26 | }
27 |
28 | // Token: 0x06000003 RID: 3 RVA: 0x00002061 File Offset: 0x00000261
29 | public Sprite(string textureDict, string textureName, PointF position, SizeF size, float heading, Color color)
30 | {
31 | this.TextureDict = textureDict;
32 | this.TextureName = textureName;
33 | this.Position = position;
34 | this.Size = size;
35 | this.Heading = heading;
36 | this.Color = color;
37 | this.Visible = true;
38 | }
39 |
40 | // Token: 0x06000004 RID: 4 RVA: 0x000020A0 File Offset: 0x000002A0
41 | public Sprite(string textureDict, string textureName, PointF position, SizeF size) : this(textureDict, textureName, position, size, 0f, Color.FromArgb(255, 255, 255, 255))
42 | {
43 | }
44 |
45 | // Token: 0x06000005 RID: 5 RVA: 0x000020D8 File Offset: 0x000002D8
46 | public void Draw()
47 | {
48 | if (!this.Visible)
49 | {
50 | return;
51 | }
52 | if (!Function.Call(91750494399812324L, new InputArgument[]
53 | {
54 | this.TextureDict
55 | }))
56 | {
57 | Function.Call(-2332038263791780395L, new InputArgument[]
58 | {
59 | this.TextureDict,
60 | true
61 | });
62 | }
63 | float width = (float)Screen.Resolution.Width;
64 | int height = Screen.Resolution.Height;
65 | float num = width / (float)height;
66 | float num2 = 1080f * num;
67 | float num3 = this.Size.Width / num2;
68 | float num4 = this.Size.Height / 1080f;
69 | float num5 = this.Position.X / num2 + num3 * 0.5f;
70 | float num6 = this.Position.Y / 1080f + num4 * 0.5f;
71 | Function.Call(-1729472009930024816L, new InputArgument[]
72 | {
73 | this.TextureDict,
74 | this.TextureName,
75 | num5,
76 | num6,
77 | num3,
78 | num4,
79 | this.Heading,
80 | this.Color.R,
81 | this.Color.G,
82 | this.Color.B,
83 | this.Color.A
84 | });
85 | }
86 |
87 | // Token: 0x06000006 RID: 6 RVA: 0x00002270 File Offset: 0x00000470
88 | public static void Draw(string dict, string name, int xpos, int ypos, int boxWidth, int boxHeight, float rotation, Color color)
89 | {
90 | if (!Function.Call(91750494399812324L, new InputArgument[]
91 | {
92 | dict
93 | }))
94 | {
95 | Function.Call(-2332038263791780395L, new InputArgument[]
96 | {
97 | dict,
98 | true
99 | });
100 | }
101 | float width = (float)Screen.Resolution.Width;
102 | int height = Screen.Resolution.Height;
103 | float num = width / (float)height;
104 | float num2 = 1080f * num;
105 | float num3 = (float)boxWidth / num2;
106 | float num4 = (float)boxHeight / 1080f;
107 | float num5 = (float)xpos / num2 + num3 * 0.5f;
108 | float num6 = (float)ypos / 1080f + num4 * 0.5f;
109 | Function.Call(-1729472009930024816L, new InputArgument[]
110 | {
111 | dict,
112 | name,
113 | num5,
114 | num6,
115 | num3,
116 | num4,
117 | rotation,
118 | color.R,
119 | color.G,
120 | color.B,
121 | color.A
122 | });
123 | }
124 |
125 | // Token: 0x06000007 RID: 7 RVA: 0x000023B4 File Offset: 0x000005B4
126 | public static string WriteFileFromResources(Assembly yourAssembly, string fullResourceName)
127 | {
128 | string tempFileName = Path.GetTempFileName();
129 | return Sprite.WriteFileFromResources(yourAssembly, fullResourceName, tempFileName);
130 | }
131 |
132 | // Token: 0x06000008 RID: 8 RVA: 0x000023D0 File Offset: 0x000005D0
133 | public static string WriteFileFromResources(Assembly yourAssembly, string fullResourceName, string savePath)
134 | {
135 | using (Stream manifestResourceStream = yourAssembly.GetManifestResourceStream(fullResourceName))
136 | {
137 | if (manifestResourceStream != null)
138 | {
139 | byte[] buffer = new byte[manifestResourceStream.Length];
140 | manifestResourceStream.Read(buffer, 0, Convert.ToInt32(manifestResourceStream.Length));
141 | using (FileStream fileStream = File.Create(savePath))
142 | {
143 | fileStream.Write(buffer, 0, Convert.ToInt32(manifestResourceStream.Length));
144 | fileStream.Close();
145 | }
146 | }
147 | }
148 | return Path.GetFullPath(savePath);
149 | }
150 |
151 | // Token: 0x04000001 RID: 1
152 | public PointF Position;
153 |
154 | // Token: 0x04000002 RID: 2
155 | public SizeF Size;
156 |
157 | // Token: 0x04000003 RID: 3
158 | public Color Color;
159 |
160 | // Token: 0x04000004 RID: 4
161 | public bool Visible;
162 |
163 | // Token: 0x04000005 RID: 5
164 | public float Heading;
165 |
166 | // Token: 0x04000006 RID: 6
167 | public string TextureName;
168 |
169 | // Token: 0x04000007 RID: 7
170 | private string _textureDict;
171 | }
172 | }
173 |
--------------------------------------------------------------------------------
/FiveM_Server/FXServer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using CitizenFX.Core;
4 | using CitizenFX.Core.Native;
5 |
6 | namespace FiveM_Server
7 | {
8 | // Token: 0x02000002 RID: 2
9 | internal class FXServer : BaseScript
10 | {
11 | // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
12 | public FXServer()
13 | {
14 | API.RegisterCommand("volume", new Action, string>(this.OnVolumeCmd), false);
15 | API.RegisterCommand("play", new Action, string>(this.OnVideoPlayCmd), false);
16 | API.RegisterCommand("pause", new Action, string>(this.OnVideoPauseCmd), false);
17 | API.RegisterCommand("stop", new Action, string>(this.OnVideoStopCmd), false);
18 | API.RegisterCommand("vtime", new Action, string>(this.OnVideoTimeCmd), false);
19 | API.RegisterCommand("url", new Action, string>(this.OnUrlCmd), false);
20 | API.RegisterCommand("yt", new Action, string>(this.OnYTCmd), false);
21 | API.RegisterCommand("player", new Action, string>(this.OnPlayerCmd), false);
22 | }
23 |
24 | // Token: 0x06000002 RID: 2 RVA: 0x00002144 File Offset: 0x00000344
25 | private void OnVolumeCmd(int playerId, List