-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.lua
More file actions
27 lines (22 loc) · 821 Bytes
/
client.lua
File metadata and controls
27 lines (22 loc) · 821 Bytes
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
if Config.Framework == 'esx' then
ESX = exports['es_extended']:getSharedObject()
elseif Config.Framework == 'qbcore' then
QBCore = exports['qb-core']:GetCoreObject()
end
RegisterNetEvent('pedmenu:setPed')
AddEventHandler('pedmenu:setPed', function(pedModel)
local modelHash = GetHashKey(pedModel)
RequestModel(modelHash)
while not HasModelLoaded(modelHash) do
Wait(1)
end
SetPlayerModel(PlayerId(), modelHash)
SetModelAsNoLongerNeeded(modelHash)
-- Reset clothes to make ped look right
SetPedDefaultComponentVariation(PlayerPedId())
if Config.Framework == 'esx' then
ESX.ShowNotification('Tvoj ped bol zmenený!')
elseif Config.Framework == 'qbcore' then
QBCore.Functions.Notify('Tvoj ped bol zmenený!', 'success')
end
end)