├── cl_spawn.lua
├── fxmanifest.lua
└── html
├── index.html
├── index.js
└── style.css
/cl_spawn.lua:
--------------------------------------------------------------------------------
1 | local QBCore = exports['qb-core']:GetCoreObject()
2 | local LoginSafe, Cam = nil, false
3 | local spawns = {
4 | [1] = {coords = vector3(282.60, -619.21, 42.020), label = "Motel & Hastane"},
5 | [2] = {coords = vector3(1811.14, 3677.75, 34.27), label = "Sandy Shores"},
6 | [3] = {coords = vector3(-1833.96, -1223.5, 13.02), label = "Santa Monica İskelesi"},
7 | [4] = {coords = vector3(949.94, 117.59, 80.75), label = "Diamond Casino"},
8 | [5] = {coords = vector3(145.62, 6563.19, 32.0), label = "Paleto Gaz İstasyonu"},
9 | [6] = {coords = vector3(477.981, -976.46, 27.98), label = "Mission Row PD"},
10 | [7] = {coords = vector3(-104.77, -1093.01, 26.12), label = "Galeri & Çekilmiş"},
11 | [8] = {coords = vector3(1852.95, 2585.95, 45.67), label = "Hapishane"},
12 | }
13 |
14 | RegisterCommand('stest', function()
15 | TriggerEvent('qy-spawn:opennui')
16 | end)
17 |
18 | RegisterNetEvent("qy-spawn:opennui")
19 | AddEventHandler("qy-spawn:opennui", function(pos)
20 | SendNUIMessage({ data = spawns, lastpos = pos })
21 | openCam()
22 | SetNuiFocus(true, true)
23 | end)
24 |
25 | RegisterNUICallback("close", function(data)
26 | SetNuiFocus(false, false)
27 | Cam = false
28 | DoScreenFadeOut(1000)
29 | end)
30 |
31 | RegisterNUICallback("spawn", function(data)
32 | DoScreenFadeOut(1000)
33 | SetNuiFocus(false, false)
34 | TriggerEvent("qy-spawn:client:loadplayer", data.coords)
35 | end)
36 |
37 | RegisterNUICallback('sonkonum', function(data, cb)
38 | DoScreenFadeOut(500)
39 | SetNuiFocus(false, false)
40 | QBCore.Functions.GetPlayerData(function(PlayerData)
41 | TriggerEvent("qy-spawn:client:loadplayer", PlayerData.position)
42 | end)
43 | end)
44 |
45 | RegisterNetEvent("qy-spawn:client:loadplayer")
46 | AddEventHandler("qy-spawn:client:loadplayer", function(coords)
47 | delCam()
48 | doCamera(coords.x,coords.y,coords.z)
49 | DoScreenFadeOut(2)
50 |
51 | delCam()
52 | SetEntityCoords(PlayerPedId(),coords.x,coords.y,coords.z)
53 | SetEntityHeading(PlayerPedId(),coords.w)
54 | SetEntityVisible(PlayerPedId(), true)
55 | Wait(200)
56 |
57 | DoScreenFadeIn(2500) -- Karakter Yükleme
58 | TriggerServerEvent('QBCore:Server:OnPlayerLoaded')
59 | TriggerEvent('QBCore:Client:OnPlayerLoaded')
60 | TriggerEvent('gr-ambulance:check-death')
61 | end)
62 |
63 | function delCam()
64 | ClearFocus()
65 | DestroyAllCams(true)
66 | RenderScriptCams(false, true, 1, true, true)
67 | end
68 |
69 | function openCam()
70 | LoginSafe = CreateCam("DEFAULT_SCRIPTED_CAMERA", 1)
71 | local camCoords = {-3968.85, 2015.93, 502.22}
72 | SetCamRot(LoginSafe, -90.0, 0.0, 250.0, 2)
73 | SetCamCoord(LoginSafe, camCoords[1], camCoords[2], camCoords[3])
74 | StopCamShaking(LoginSafe, true)
75 | SetCamFov(LoginSafe, 50.0)
76 | SetCamActive(LoginSafe, true)
77 | RenderScriptCams(true, false, 0, true, true)
78 | end
79 |
80 | cam = 0
81 | function doCamera(x,y,z)
82 | DoScreenFadeOut(1)
83 | if(not DoesCamExist(cam)) then
84 | cam = CreateCam('DEFAULT_SCRIPTED_CAMERA', true)
85 | end
86 |
87 | i = 3200
88 | SetFocusArea(x, y, z, 0.0, 0.0, 0.0)
89 | SetCamActive(cam, true)
90 | RenderScriptCams(true, false, 0, true, true)
91 | DoScreenFadeIn(1500)
92 | local camAngle = -90.0
93 | while i > 1 do
94 | local factor = i / 50
95 | if i < 1 then i = 1 end
96 | i = i - factor
97 | SetCamCoord(cam, x,y,z+i)
98 | if i < 1200 then
99 | DoScreenFadeIn(600)
100 | end
101 | if i < 90.0 then
102 | camAngle = i - i - i
103 | end
104 | SetCamRot(cam, camAngle, 0.0, 0.0)
105 | Citizen.Wait(2/i)
106 | end
107 | end
108 |
--------------------------------------------------------------------------------
/fxmanifest.lua:
--------------------------------------------------------------------------------
1 | fx_version 'cerulean'
2 |
3 | game 'gta5'
4 |
5 | ui_page 'html/index.html'
6 |
7 | files {'html/*.html', 'html/*.js', 'html/*.css'}
8 |
9 | client_script 'cl_spawn.lua'
10 |
--------------------------------------------------------------------------------
/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Konum Seç
19 | Geri dön şef, Ordunun sana ihtiyacı var.
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/html/index.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function(){
2 | $(".container").hide();
3 | $(".info-box").hide();
4 | var current
5 | var pos
6 | var lastpos
7 |
8 | window.addEventListener("message", function(event){
9 | var data = event.data
10 | lastpos = data.lastpos
11 | $(".container").show()
12 | createButtons(data.data)
13 | });
14 |
15 |
16 |
17 | // Function
18 | function createButtons(data) {
19 | var len = data.length
20 | for (i=0; i < len; i++) {
21 | $(".spawn-points").append('' + data[i].label + '
');
22 | $(".spawn-points").find("[data-id="+i+"]").data("data", data[i]);
23 | $(".spawn-points").find("[data-id="+i+"]").data("coords", data[i].coords);
24 | $(".spawn-points").find("[data-id="+i+"]").data("id", i);
25 | }
26 | }
27 |
28 |
29 |
30 | // İconlar
31 | $(document).on("mouseenter", ".fas", function(e){
32 | var th = $(this)
33 | $("#label"+th.data("id")).fadeIn(150);
34 | if (th.data("data").label != null) {
35 | $("#label"+current).fadeOut(150);
36 | }
37 | });
38 |
39 | $(document).on("mouseleave", ".fas", function(e){
40 | var th = $(this)
41 | if ("#label" + th.data("id") != "#label"+current) {
42 | $("#label"+th.data("id")).fadeOut(150);
43 | }
44 | });
45 |
46 | $(document).on("click", ".fas", function(e){
47 | var th = $(this)
48 | if (current != null) {
49 | $("#loc"+current).css("color", "rgb(255, 65, 65)");
50 | $("#loc"+current).css("font-size", "x-large");
51 | $("#label"+current).fadeOut(400);
52 | }
53 | $("#loc"+th.data("id")).css("color", "rgb(253, 253, 253)");
54 | current = th.data("id")
55 | pos = th.data("coords")
56 | });
57 |
58 |
59 |
60 | // Butonlar
61 | $(document).on("click", ".fa-map-marker-alt", function(e){
62 | if (pos != null) {
63 | $(".container").fadeOut(500)
64 | $.post('https://gr-spawn/spawn', JSON.stringify({coords: pos}));
65 | $('#info').hide()
66 | }
67 | });
68 |
69 | $(document).on("click", ".lastspawn", function(e){
70 | $(".container").fadeOut(500)
71 | $.post('https://gr-spawn/sonkonum', JSON.stringify({coords: pos}));
72 | $('#info').hide()
73 | });
74 |
75 |
76 |
77 | })
--------------------------------------------------------------------------------
/html/style.css:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@500;700&display=swap');
2 |
3 | body {
4 | overflow: hidden;
5 | display: hidden;
6 | padding: 0;
7 | margin: 0;
8 | font-family: 'Exo 2', sans-serif;
9 | }
10 |
11 | .container {
12 | width: 100%;
13 | height: 100%;
14 | }
15 |
16 | *::selection {
17 | background-color: transparent;
18 | }
19 |
20 | p {
21 | position: absolute;
22 | left: 87.25%;
23 | top: 85.85%;
24 | color: white;
25 | }
26 |
27 | .fa-map-marker-alt, .fa-map-marker {
28 | position: absolute;
29 | font-size: x-large;
30 | color: #ff4444;
31 | text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 3px #000, 0 0 3px #000;
32 | transition: font-size 0.25s;
33 | }
34 |
35 | .info-box {
36 | display: none;
37 | background: #222831e8;
38 | border-radius: 3.5px;
39 | position: absolute;
40 | color: white;
41 | font-size: 12px;
42 | width: 750%;
43 | height: 100%;
44 | text-align: center;
45 | bottom: -5%;
46 | left: 120%;
47 | padding-top: 50%;
48 | font-family: 'Exo 2', sans-serif;
49 | z-index: 100;
50 | }
51 |
52 | .information {
53 | position: absolute;
54 | top: 73.25%;
55 | left: 2.5%;
56 | width: 15.5%;
57 | height: 25%;
58 | text-align: center;
59 | }
60 |
61 | #info {
62 | left: 25%;
63 | top: 25%;
64 | color:rgba(20, 16, 16, 0.692);
65 | font-family: 'Exo 2', sans-serif;
66 | font-size: xx-large;
67 | border-radius: 10px;
68 | border-bottom: 10px;
69 | }
70 |
71 | .spawn-help h3 {
72 | margin: 0;
73 | font-size: 3vh;
74 | }
75 |
76 | .spawn-help {
77 | position: absolute;
78 | left: 0;
79 | bottom: 0;
80 | margin: 0 auto;
81 | width: 14%;
82 | background: #191e25;
83 | text-align: center;
84 | color: white;
85 | font-size: 1.3vh;
86 | padding: 1.5vh;
87 | font-family: "Roboto", "Helvetica", "Arial", sans-serif;
88 | border-top-right-radius: 4vh;
89 | }
90 |
91 | .spawn {
92 | height: 3vh;
93 | font-size: 1.2vh;
94 | text-decoration: none;
95 | background-color: #8fe077;
96 | color: #222831;
97 | border-radius: 1vh;
98 | text-transform: uppercase;
99 | border: none;
100 | font-family: "Roboto", "Helvetica", "Arial", sans-serif;
101 | padding: 0 2vh;
102 | }
103 |
104 | .lastspawn {
105 | height: 3vh;
106 | font-size: 1.2vh;
107 | text-decoration: none;
108 | background-color: #f2a365;
109 | color: #222831;
110 | border-radius: 1vh;
111 | text-transform: uppercase;
112 | border: none;
113 | font-family: "Roboto", "Helvetica", "Arial", sans-serif;
114 | padding: 0 2vh;
115 | }
116 |
117 | .spawn:hover, .lastspawn:hover {
118 | opacity: 0.8;
119 | }
120 |
121 | #loc0 { /* Motel */
122 | top: 48.5%;
123 | left: 62%;
124 | }
125 |
126 | #loc1 { /* Sandy Shores */
127 | top: 33.5%;
128 | left: 38.2%;
129 | }
130 |
131 | #loc2 { /* Santa Monica İskelesi */
132 | top: 73%;
133 | left: 68.35%;
134 | }
135 |
136 | #loc3 { /* Diamond Casino */
137 | top: 42.6%;
138 | left: 60.5%;
139 | }
140 |
141 | #loc4 { /* Paleto Gas Stop */
142 | top: 53%;
143 | left: 20.2%;
144 | }
145 |
146 | #loc5 { /* Departman */
147 | top: 48%;
148 | left: 67%;
149 | }
150 |
151 | #loc6 { /* Galeri ve Çekişmişler */
152 | top: 54%;
153 | left: 67%;
154 | }
155 |
156 | #loc7 { /* Hapishane */
157 | top: 33%;
158 | left: 44.5%;
159 | }
--------------------------------------------------------------------------------