Police job fix plz


#1

hello i have a script that is police change job like to make you officer our els
but this affec a random t the skin of my player that they not police why ?
can some on fix it to me

client side

RegisterNetEvent(“loadout:changeSkin”)
AddEventHandler(“loadout:changeSkin”, function(skinName)
if skinName == nil then
Citizen.Trace(“skin was null.\n”)
return
end

Citizen.CreateThread(function()
    local model = GetHashKey(skinName)
    RequestModel(model)
    while not HasModelLoaded(model) do -- Wait for model to load
        RequestModel(model)
        Citizen.Wait(0)
    end
    SetPlayerModel(PlayerId(), model)
    SetModelAsNoLongerNeeded(model)
end)

end)

AddEventHandler(“playerSpawned”, function(spawn)
TriggerServerEvent(“loadout:playerSpawned”, spawn)
end)

RegisterNetEvent(“loadout:giveWeapon”)
AddEventHandler(“loadout:giveWeapon”, function(name, delayTime)
if delayTime == nil then
delayTime = 0
end

Citizen.CreateThread(function()
    Wait(delayTime)
    local hash = GetHashKey(name)
    GiveWeaponToPed(GetPlayerPed(-1), hash, 1000, 0, false)
end)

end)

RegisterNetEvent(“loadout:missiontext”)
AddEventHandler(“loadout:missiontext”, function(text, time)
ClearPrints()
SetTextEntry_2(“STRING”)
AddTextComponentString(text)
DrawSubtitleTimed(time, 1)
end)

loadout.lua

– Edit the table below for more loadouts!
LOADOUTS = {
[“recrue”] = {
name = “recrue”,
permission_level = 1,
weapons = { “WEAPON_PISTOL50”, “WEAPON_STUNGUN”, “WEAPON_NIGHTSTICK”, “WEAPON_PUMPSHOTGUN”, },
skins = { “s_m_y_cop_01” }
},
[“brigadier”] = {
name = “brigadier”,
permission_level = 2,
weapons = { “WEAPON_PISTOL50”, “WEAPON_STUNGUN”, “WEAPON_NIGHTSTICK”, “WEAPON_PUMPSHOTGUN”, “WEAPON_ASSAULTSMG” },
skins = { “s_m_y_swat_01”}
},
[“sergent”] = {
name = “sergent”,
permission_level = 3,
weapons = { “WEAPON_PISTOL50”, “WEAPON_STUNGUN”, “WEAPON_NIGHTSTICK”, “WEAPON_PUMPSHOTGUN”, “WEAPON_ASSAULTSMG” },
skins = { “s_m_y_swat_01” }
},
[“smur”] = {
name = “smur”,
permission_level = 4,
weapons = { “Flashlight” },
skins = { “s_m_m_paramedic_01” }
},
[“random”] = {
name = “Random”,
weapons = { “WEAPON_PETROLCAN” },
skins = {“a_m_y_skater_01”,
“a_m_y_skater_02”,
“a_m_m_beach_01”,
“a_m_m_bevhills_01”,
“a_m_m_bevhills_02”,
“a_m_m_business_01”,
“a_m_m_eastsa_01”,
“a_m_m_eastsa_02”,
“a_m_m_farmer_01”,
“a_m_m_genfat_01”,
“a_m_m_golfer_01”,
“a_m_m_hillbilly_01”,
“a_m_m_indian_01”,
“a_m_m_mexcntry_01”,
“a_m_m_paparazzi_01”,
“a_m_m_tramp_01”,
“a_m_y_hiker_01”,
“a_m_y_hippy_01”,
“a_m_y_genstreet_01”,
“a_m_m_socenlat_01”,
“a_m_m_og_boss_01”,
“a_f_y_tourist_02”,
“a_f_y_tourist_01”,
“a_f_y_soucent_01”,
“a_f_y_scdressy_01”,
“a_m_y_cyclist_01”,
“a_m_y_golfer_01”
}
}
}

server.lua

https://pastebin.com/10735Afz


#3

What are you trying to do? What is happening?

Also, as a heads up, the plugin has been updated since you’ve downloaded it, you can find the newest version here.

Also, @Denisbart619 please use English on the forum (if you can, use Google translate or something).


#4

@Havoc It’s a french guy.

@Havoc I have job system : [Release] Jobs System v2.1 and Paycheck v2.1

And who to made for select jo


#5

i tried to remove the random skin citizen
evry one spam with random skin when he is not police offive
r


#6

Remove this:

And

[quote="aviatex, post:1, topic:17080"]
["random"] = {
        name = "Random",
        weapons = { "WEAPON_PETROLCAN" },
        skins = {"a_m_y_skater_01",
            "a_m_y_skater_02",
            "a_m_m_beach_01",
            "a_m_m_bevhills_01",
            "a_m_m_bevhills_02",
            "a_m_m_business_01",
            "a_m_m_eastsa_01",
            "a_m_m_eastsa_02",
            "a_m_m_farmer_01",
            "a_m_m_genfat_01",
            "a_m_m_golfer_01",
            "a_m_m_hillbilly_01",
            "a_m_m_indian_01",
            "a_m_m_mexcntry_01",
            "a_m_m_paparazzi_01",
            "a_m_m_tramp_01",
            "a_m_y_hiker_01",
            "a_m_y_hippy_01",
            "a_m_y_genstreet_01",
            "a_m_m_socenlat_01",
            "a_m_m_og_boss_01",
            "a_f_y_tourist_02",
            "a_f_y_tourist_01",
            "a_f_y_soucent_01",
            "a_f_y_scdressy_01",
            "a_m_y_cyclist_01",
            "a_m_y_golfer_01"
        }
    }
[/quote]

This will remove player's spawning with random skins.