This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
client.lua
680 lines (613 loc) · 22.5 KB
/
client.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
--[[To add clothes, copy the hash, paste it at the end of the list and add range in slider(_f means women Only MP components work)--]]
local lista_kapelusze = {} --hat
local lista_kapelusze_f = {}
----------------------------------------------------------------------------------------------------------------------------
local lista_koszula = {} --shirt
local lista_koszula_f = {}
--------------------------------------------------------------------------------------------------------------------------------------
local lista_kamizelka = {} --vest
local lista_kamizelka_f = {}
--------------------------------------------
local lista_spodnie = {} --pants
local lista_spodnie_f = {}
------------------------------------------
local lista_maska = {} --mask
local lista_maska_f = {}
------------------------------------------
local lista_buty = {} --boots
local lista_buty_f = {}
-----------------------------------------
local lista_plaszcz = {} --coats
local lista_plaszcz_f = {}
---------------------------------------
local lista_rekawiczki = {}
local lista_rekawiczki_f = {}
local lista_bandana = {}
local lista_bandana_f = {}
--local lista_rekawiczki_f = {}
local femaletorsos = {}
local femalelegs = {}
local maletorsos = {}
local malelegs = {}
local legs = nil
local legs2 = nil
local torso = nil
local torso2 = nil
local lista_spodnica = {} --skirt
local adding2 = true
local adding = true
local glowna = lista_kapelusze
local sex_global = 1
local cam = nil
Citizen.CreateThread(function()
while adding do
Citizen.Wait(0)
--print("Dzieje sie")
for i, v in ipairs(MaleComp) do
if v.category == "hats" then
table.insert(lista_kapelusze, v.Hash)
elseif v.category == "shirts" then
table.insert(lista_koszula, v.Hash)
elseif v.category == "vests" then
table.insert(lista_kamizelka, v.Hash)
elseif v.category == "pants" then
table.insert(lista_spodnie, v.Hash)
elseif v.category == "masks" then
table.insert(lista_maska, v.Hash)
elseif v.category == "coats" then
table.insert(lista_plaszcz, v.Hash)
elseif v.category == "boots" then
table.insert(lista_buty, v.Hash)
elseif v.category == "torsos" then
table.insert(maletorsos, v.Hash)
elseif v.category == "legs" then
table.insert(malelegs, v.Hash)
elseif v.category == "gloves" then
table.insert(lista_rekawiczki, v.Hash)
elseif v.category == "neckwear" then
table.insert(lista_bandana, v.Hash)
end
end
adding = false
end
end)
Citizen.CreateThread(function()
while adding2 do
Citizen.Wait(0)
--print("Dzieje sie 2")
for i, v in ipairs(FemaleComp) do
if v.category == "hats" then
table.insert(lista_kapelusze_f, v.hash)
elseif v.category == "shirts" then
table.insert(lista_koszula_f, v.hash)
elseif v.category == "vests" then
table.insert(lista_kamizelka_f, v.hash)
elseif v.category == "pants" then
table.insert(lista_spodnie_f, v.hash)
elseif v.category == "boots" then
table.insert(lista_buty_f, v.hash)
elseif v.category == "masks" then
table.insert(lista_maska_f, v.hash)
elseif v.category == "coats" then
table.insert(lista_plaszcz_f, v.hash)
elseif v.category == "skirts" then
table.insert(lista_spodnica, v.hash)
elseif v.category == "torsos" then
table.insert(femaletorsos, v.hash)
elseif v.category == "legs" then
table.insert(femalelegs, v.hash)
elseif v.category == "gloves" then
table.insert(lista_rekawiczki_f, v.hash)
elseif v.category == "neckwear" then
table.insert(lista_bandana_f, v.hash)
else end
end
adding2 = false
end
end)
RegisterNetEvent('redem_clothing:sex')
AddEventHandler('redem_clothing:sex', function(skin)
local _skin = json.decode(skin)
local sex = 1
if _skin.sex == "male" then
sex = 1
sex_global = sex
if tonumber(_skin.skin) == 1 then
torso = '0x' .. maletorsos[6]
legs = '0x' .. malelegs[5]
elseif tonumber(_skin.skin) == 2 then
torso = '0x' .. maletorsos[2]
legs = '0x' .. malelegs[5]
elseif tonumber(_skin.skin) == 3 then
torso = '0x' .. maletorsos[4]
legs = '0x' .. malelegs[1]
elseif tonumber(_skin.skin) == 4 then
torso = '0x' .. maletorsos[7]
legs = '0x' .. malelegs[3]
elseif tonumber(_skin.skin) == 5 then
torso = '0x' .. maletorsos[5]
legs = '0x' .. malelegs[4]
elseif tonumber(_skin.skin) == 6 then
torso = '0x' .. maletorsos[3]
legs = '0x' .. malelegs[2]
else end
else
sex = 2
sex_global = sex
if tonumber(_skin.skin) == 1 then
torso2 = '0x' .. femaletorsos[6]
legs2 = '0x' .. femalelegs[1]
elseif tonumber(_skin.skin) == 2 then
torso2 = '0x' .. femaletorsos[3]
legs2 = '0x' .. femalelegs[2]
elseif tonumber(_skin.skin) == 3 then
torso2 = '0x' .. femaletorsos[2]
legs2 = '0x' .. femalelegs[3]
elseif tonumber(_skin.skin) == 4 then
torso2 = '0x' .. femaletorsos[4]
legs2 = '0x' .. femalelegs[5]
elseif tonumber(_skin.skin) == 5 then
torso2 = '0x' .. femaletorsos[8]
legs2 = '0x' .. femalelegs[6]
elseif tonumber(_skin.skin) == 6 then
torso2 = '0x' .. femaletorsos[9]
legs2 = '0x' .. femalelegs[8]
else end
end
startUI(sex)
SetNuiFocus(true, true)
camera(3.1,-0.15)
end)
function startUI(sex)
local sex1 = sex
SendNUIMessage({
type = "ui",
display = true,
sex3 = sex1
})
end
function hideUI()
SendNUIMessage({
type = "ui",
display = false
})
end
RegisterCommand('clothing', function(source, args)
TriggerServerEvent("redem_clothing:sex_test", function(cb)
end)
end)
RegisterNUICallback('heading', function(heading)
local playerPed = PlayerPedId()
local _heading = heading/1 -- yes :1 xD
print(_heading)
SetEntityHeading(playerPed, _heading)
end)
RegisterNUICallback('Save', function(data, cb)
SetNuiFocus(false, false)
destory()
local elementy = {
["kapelusz"] = data.kapelusz,
["koszula"] = data.koszula,
["kamizelka"] = data.kamizelka,
["spodnie"] = data.spodnie,
["maska"] = data.maska,
["buty"] = data.buty,
["spodnica"] = data.spodnica,
["plaszcz"] = data.plaszcz,
["rekawiczki"] = data.rekawiczki,
["bandana"] = data.bandana
}
--print("tak1")
print(tonumber(elementy.kapelusz)) -- INCOMING
local price = 0
local json = json.encode(elementy)
TriggerServerEvent("redem_clothing:Save", json, price, function(cb)
if cb then
print("DONE")
else
print("ERROR")
end
end)
-- print("tak2")
end)
RegisterNUICallback('Camera', function()
camera(3.1,-0.15)
end)
RegisterNUICallback('komponent', function(component)
if sex_global == 1 then
if component == "kapelusz" then
glowna = lista_kapelusze
camera(1.5,0.4)
elseif component == "koszula" then
glowna = lista_koszula
camera(1.8,0.1)
elseif component == "kamizelka" then
glowna = lista_kamizelka
camera(1.8,0.1)
elseif component == "spodnie" then
glowna = lista_spodnie
camera(2.2,-0.3)
elseif component == "maska" then
glowna = lista_maska
camera(1.5,0.4)
elseif component == "buty" then
glowna = lista_buty
camera(1.8,-0.6)
elseif component == "plaszcz" then
glowna = lista_plaszcz
camera(2.5,0.1)
elseif component == "rekawiczki" then
glowna = lista_rekawiczki
camera(1.8,-0.3)
elseif component == "bandana" then
glowna = lista_bandana
camera(1.5,0.4)
end
elseif sex_global == 2 then
if component == "kapelusz" then
glowna = lista_kapelusze_f
camera(1.5,0.4)
elseif component == "koszula" then
glowna = lista_koszula_f
camera(1.8,0.1)
elseif component == "kamizelka" then
glowna = lista_kamizelka_f
camera(1.8,0.1)
elseif component == "spodnie" then
glowna = lista_spodnie_f
camera(2.2,-0.3)
elseif component == "maska" then
glowna = lista_maska_f
camera(1.5,0.4)
elseif component == "buty" then
glowna = lista_buty_f
camera(1.8,-0.6)
elseif component == "spodnica" then
glowna = lista_spodnica
camera(2.2,-0.3)
elseif component == "plaszcz" then
glowna = lista_plaszcz_f
camera(2.5,0.1)
elseif component == "rekawiczki" then
glowna = lista_rekawiczki_f
camera(1.8,-0.3)
elseif component == "bandana" then
glowna = lista_bandana_f
camera(1.5,0.4)
end
end
--print(component)
end)
RegisterNUICallback('zmiana', function(wartosc)
local wartosc2 = tonumber(wartosc)
local hash = ("0x" .. glowna[wartosc2])
--print(glowna[wartosc2])
if glowna == lista_spodnie_f and wartosc2 <= 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x1D4C528A, 0) -- Set target category, here the hash is for hats
Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),tonumber(legs2),true,true,true)
elseif glowna == lista_spodnie and wartosc2 <= 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x1D4C528A, 0) -- Set target category, here the hash is for hats
Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),tonumber(legs),true,true,true)
elseif glowna == lista_koszula and wartosc2 <= 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x2026C46D, 0) -- Set target category, here the hash is for hats
Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),tonumber(torso),true,true,true)
elseif glowna == lista_koszula_f and wartosc2 <= 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x2026C46D, 0) -- Set target category, here the hash is for hats
Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),tonumber(torso2),true,true,true)
elseif (glowna == lista_maska_f or glowna == lista_maska) and wartosc2 == 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x7505EF42, 0) -- Set target category, here the hash is for hats
-- Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
elseif (glowna == lista_rekawiczki or glowna == lista_rekawiczki_f) and wartosc2 == 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0xEABE0032, 0) -- Set target category, here the hash is for hats
-- Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
elseif (glowna == lista_bandana or glowna == lista_bandana_f) and wartosc2 == 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x5FC29285, 0) -- Set target category, here the hash is for hats
-- Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
elseif (glowna == lista_kapelusze_f or glowna == lista_kapelusze) and wartosc2 == 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x9925C067, 0) -- Set target category, here the hash is for hats
-- Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
elseif glowna == lista_spodnica and wartosc2 == 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0xA0E3AB7F, 0) -- Set target category, here the hash is for hats
-- Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
elseif (glowna == lista_plaszcz_f or glowna == lista_plaszcz) and wartosc2 == 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x662AC34, 0) -- Set target category, here the hash is for hats
-- Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
elseif (glowna == lista_kamizelka_f or glowna == lista_kamizelka) and wartosc2 == 1 then
Citizen.InvokeNative(0xD710A5007C2AC539, PlayerPedId(), 0x485EE834, 0) -- Set target category, here the hash is for hats
-- Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
else
Citizen.InvokeNative(0xD3A7B003ED343FD9 , PlayerPedId(), tonumber(hash), true, true, true)
end
Citizen.InvokeNative(0xCC8CA3E88256E58F, PlayerPedId(), 0, 1, 1, 1, 0) -- Actually remove the component
if glowna == lista_buty then
Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),tonumber(legs),true,true,true)
elseif glowna == lista_spodnie_f or lista_buty_f then
Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),tonumber(legs2),true,true,true)
elseif glowna == lista_koszula then
Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),tonumber(torso),true,true,true)
elseif glowna == lista_koszula_f then
Citizen.InvokeNative(0xD3A7B003ED343FD9, PlayerPedId(),tonumber(torso2),true,true,true)
end
end)
RegisterNetEvent('redem_clothing:load2')
AddEventHandler('redem_clothing:load2', function()
TriggerServerEvent("redem_clothing:loadClothes", function(cb)
end)
end)
RegisterNetEvent('redem_clothing:load_def')
AddEventHandler('redem_clothing:load_def', function()
TriggerServerEvent("redemrp_skin:loadSkin", function(cb)
end)
end)
RegisterCommand("loadcloath", function(source, args)
TriggerServerEvent("redem_clothing:loadClothes", function(cb)
end)
print(lista_kapelusze[5])
print(lista_spodnie_f[5])
end)
RegisterNetEvent('redem_clothing:load')
AddEventHandler('redem_clothing:load', function(skin, ubranie)
local _skin = json.decode(skin)
local _ubranie = json.decode(ubranie)
local sex = 1
local hash = nil
local wartosc = 1
--print (_skin.sex)
if _skin.sex == "male" then
sex = 1
else
sex = 2
end
if sex == 1 then
Wait(300)
glowna = lista_maska
wartosc = tonumber(_ubranie.maska)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło5")
end
Wait(300)
glowna = lista_kapelusze
wartosc = tonumber(_ubranie.kapelusz)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło1")
end
Wait(300)
glowna = lista_koszula
wartosc = tonumber(_ubranie.koszula)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło2")
end
Wait(300)
glowna = lista_kamizelka
wartosc = tonumber(_ubranie.kamizelka)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło3")
end
Wait(300)
glowna = lista_plaszcz
wartosc = tonumber(_ubranie.plaszcz)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło1")
end
Wait(300)
glowna = lista_spodnie
wartosc = tonumber(_ubranie.spodnie)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło4")
end
Wait(300)
glowna = lista_buty
wartosc = tonumber(_ubranie.buty)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło6")
end
Wait(300)
glowna = lista_rekawiczki
wartosc = tonumber(_ubranie.rekawiczki)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło6")
end
Wait(300)
glowna = lista_bandana
wartosc = tonumber(_ubranie.bandana)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło6")
end
else
Wait(300)
glowna = lista_maska_f
wartosc = tonumber(_ubranie.maska)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło5")
end
glowna = lista_kapelusze_f
wartosc = tonumber(_ubranie.kapelusz)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło1")
end
Wait(300)
glowna = lista_koszula_f
wartosc = tonumber(_ubranie.koszula)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło2")
end
Wait(300)
glowna = lista_kamizelka_f
wartosc = tonumber(_ubranie.kamizelka)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło3")
end
Wait(300)
glowna = lista_plaszcz_f
wartosc = tonumber(_ubranie.plaszcz)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło5")
end
Wait(300)
glowna = lista_spodnie_f
wartosc = tonumber(_ubranie.spodnie)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło4")
end
Wait(300)
glowna = lista_buty_f
wartosc = tonumber(_ubranie.buty)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło6")
end
Wait(300)
glowna = lista_spodnica
wartosc = tonumber(_ubranie.spodnica)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło7")
end
Wait(300)
glowna = lista_rekawiczki_f
wartosc = tonumber(_ubranie.rekawiczki)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło6")
end
Wait(300)
glowna = lista_bandana_f
wartosc = tonumber(_ubranie.bandana)
if wartosc > 1 then
--print(wartosc)
hash = ("0x" .. glowna[wartosc])
ladowanie(hash)
--print("poszło6")
end
end
end)
--------------------------------------------------------------------------------------------------------------------------------------------------------------
RegisterNetEvent('redem_clothing:cancel')
AddEventHandler('redem_clothing:cancel', function()
local timer = 200
while timer > 0 do
Citizen.Wait(0)
DrawTxt("NO MONEY", 0.50, 0.90, 0.6, 0.6, true, 161, 3, 0, 255, true, 10000)
timer = timer - 1
end
end)
function ladowanie(hash)
Citizen.InvokeNative(0xD3A7B003ED343FD9 , PlayerPedId(), tonumber(hash), true, true, true)
--print("poszło13")
--print(hash)
end
function DrawTxt(str, x, y, w, h, enableShadow, col1, col2, col3, a, centre)
local str = CreateVarString(10, "LITERAL_STRING", str, Citizen.ResultAsLong())
SetTextScale(w, h)
SetTextColor(math.floor(col1), math.floor(col2), math.floor(col3), math.floor(a))
SetTextCentre(centre)
if enableShadow then SetTextDropshadow(1, 0, 0, 0, 255) end
Citizen.InvokeNative(0xADA9255D, 10);
DisplayText(str, x, y)
end
function destory()
SetCamActive(cam, false)
RenderScriptCams(false, true, 500, true, true)
DisplayHud(true)
DisplayRadar(true)
DestroyAllCams(true)
end
function camera(zoom, offset)
DestroyAllCams(true)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
local heading = 45.0
local zoomOffset = zoom
local camOffset = offset
local angle = heading * math.pi / 180.0
local theta = {
x = math.cos(angle),
y = math.sin(angle)
}
print(theta.x)
local pos = {
x = coords.x + (zoomOffset * theta.x),
y = coords.y + (zoomOffset * theta.y)
}
print(pos.x)
local angleToLook = heading - 140.0
if angleToLook > 360 then
angleToLook = angleToLook - 360
elseif angleToLook < 0 then
angleToLook = angleToLook + 360
end
print(angleToLook)
angleToLook = angleToLook * math.pi / 180.0
local thetaToLook = {
x = math.cos(angleToLook),
y = math.sin(angleToLook)
}
print(thetaToLook.x)
local posToLook = {
x = coords.x + (zoomOffset * thetaToLook.x),
y = coords.y + (zoomOffset * thetaToLook.y)
}
print(posToLook.x)
SetEntityHeading(playerPed, 334.00)
cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", pos.x-0.6, pos.y, coords.z + camOffset, 300.00,0.00,0.00, 40.00, false, 0)
PointCamAtCoord(cam, posToLook.x, posToLook.y, coords.z + camOffset)
SetCamActive(cam, true)
RenderScriptCams(true, true, 500, true, true)
DisplayHud(false)
DisplayRadar(false)
end