-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclient.lua
140 lines (119 loc) · 3.98 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
ESX = nil
clothes = false
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
function loadAnimDict(dict)
while (not HasAnimDictLoaded(dict)) do
RequestAnimDict(dict)
Citizen.Wait(5)
end
end
-------------------------- TUTO --------------------------------
----------------------------------------------------------------
-- SetPedComponentVariation(GetPlayerPed(-1), 1, 14, 2, 0) -----
-- 1 = Apparel categories example : mask, t-shirt, watch, etc --
------------------- 14 = Clothing number -----------------------
------------------- 2 = Clothing color -------------------------
----------------------------------------------------------------
----------------- if you want to add more ----------------------
----------------------------------------------------------------
RegisterNetEvent('sp_clothes:REPLACE THIS')
AddEventHandler('sp_clothes:REPLACE THIS', function()
local player = PlayerPedId()
if not clothes then
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
clothes = true
SetPedComponentVariation(GetPlayerPed(-1), 1, 64, 1, 0)
elseif clothes then
clothes = false
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
SetPedComponentVariation(GetPlayerPed(-1), 1, -1, 0, 2)
end
end)
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
RegisterNetEvent('sp_clothes:tshirt')
AddEventHandler('sp_clothes:tshirt', function()
local player = PlayerPedId()
if not clothes then
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
clothes = true
SetPedComponentVariation(GetPlayerPed(-1), 11, 14, 1, 0)
SetPedComponentVariation(GetPlayerPed(-1), 3, 12, 0, 0) -- If you want to add a t-shirt, don’t touch this because it’s for the arms
elseif clothes then
clothes = false
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
SetPedComponentVariation(GetPlayerPed(-1), 11, 15, 0, 2)
SetPedComponentVariation(GetPlayerPed(-1), 3, 15, 0, 0) -- If you want to add a t-shirt, don’t touch this because it’s for the arms
end
end)
RegisterNetEvent('sp_clothes:jeans')
AddEventHandler('sp_clothes:jeans', function()
local player = PlayerPedId()
if not clothes then
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
clothes = true
SetPedComponentVariation(GetPlayerPed(-1), 4, 13, 1, 0)
elseif clothes then
clothes = false
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
SetPedComponentVariation(GetPlayerPed(-1), 4, 21, 0, 2)
end
end)
RegisterNetEvent('sp_clothes:shoe')
AddEventHandler('sp_clothes:shoe', function()
local player = PlayerPedId()
if not clothes then
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
clothes = true
SetPedComponentVariation(GetPlayerPed(-1), 6, 1, 1, 0)
elseif clothes then
clothes = false
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
SetPedComponentVariation(GetPlayerPed(-1), 6, 5, 0, 2)
end
end)
RegisterNetEvent('sp_clothes:bag')
AddEventHandler('sp_clothes:bag', function()
local player = PlayerPedId()
if not clothes then
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
clothes = true
SetPedComponentVariation(GetPlayerPed(-1), 5, 0, 1, 0)
elseif clothes then
clothes = false
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
SetPedComponentVariation(GetPlayerPed(-1), 5, 41, 0, 2)
end
end)
RegisterNetEvent('sp_clothes:mask')
AddEventHandler('sp_clothes:mask', function()
local player = PlayerPedId()
if not clothes then
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
clothes = true
SetPedComponentVariation(GetPlayerPed(-1), 1, 64, 1, 0)
elseif clothes then
clothes = false
Wait (600)
ClearPedSecondaryTask(PlayerPedId())
SetPedComponentVariation(GetPlayerPed(-1), 1, -1, 0, 2)
end
end)