I want to set the model to player with steamid.
For ex:
steam:12314214xsa21 a_f_y_hipster_02
steam:1412561234af csb_car3guy1
etc.
Please help :C
I want to set the model to player with steamid.
For ex:
steam:12314214xsa21 a_f_y_hipster_02
steam:1412561234af csb_car3guy1
etc.
Please help :C
server script
client script
Try to create with that approach. If your server is using a database this is not the best approach but does still contain some of the logic required.
Client.lua
RegisterNetEvent('applyskin')
AddEventHandler('applyskin', function(skin)
Citizen.CreateThread(function()
local model = GetHashKey(skin)
RequestModel(model)
while not HasModelLoaded(model) do
RequestModel(model)
Citizen.Wait(0)
end
SetPlayerModel(PlayerId(), model)
SetPedComponentVariation(GetPlayerPed(-1), 0, 0, 0, 2)
end)
end)
Server.lua
local skins = {
['default'] = 'mp_m_freemode_01',
['steam:12314214xsa21'] = 'a_f_y_hipster_02'
}
RegisterServerEvent('playerSpawn')
AddEventHandler('playerSpawn', function()
local steamID = nil
for k,v in ipairs(GetPlayerIdentifiers(source)) do
if string.sub(v, 1, 5) == "steam" then
steamID = string.lower(v)
break
end
end
local skin = nil
if skins[steamID] ~= nil then
skin = skins[steamID]
else
skin = skins['default']
end
TriggerClientEvent("applyskin", source, skin)
end)
Add this : SetPedComponentVariation(GetPlayerPed(-1), 0, 0, 0, 2)
Okay, now it sets the same ped to player, i mean i have esx scripts, and it set the same ped for all players, i want to set the model only for players that are writed in lua, and i want script to let the players have their own characters.
Then search for script doing it and disable it…
but the script doing it is that u writed.
when i restart server skin set to default as mp_m_freemode_01
how to fix it ?
Hey there , blaizz can you help that script works?
Hi guys,
A question, is it possible to reset the model
I want to create a command, when you hit it, you change the player into the model
And when you hit it a second time, you come back to your “normal” skin (esx_skin, skinchanger)
You should create your own topic