i have a problem on my server, when people spawn they randomly have a weapon, sometimes they spawn with sniper, assault rifle, shotgun ect, someone know how to fix that?
You can run some thing like this to remove all weapons from everyone not really best idea mind but gives you a understanding on how to do it maybe write a script that only takes weapons from selected people so police and other people you want can still have fire arms
Citizen.CreateThread(function()
while true do
Citizen.Wait(0) -- 3000
local ply = GetPlayerPed(-1)
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_PUMPSHOTGUN"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_ASSAULTSHOTGUN"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_BULLPUPSHOTGUN"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_ASSAULTRIFLE"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_SNIPERRIFLE"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_APPistol"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_Revolver"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_PISTOL50"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_PISTOL"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_SMG"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_MICROSMG"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_ASSAULTSMG"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_ADVANCEDRIFLE"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_MG"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_COMBATMG"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_HEAVYSNIPER"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_REMOTESNIPER"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_GRENADELAUNCHER"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_MINIGUN"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_GRENADE"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_STICKYBOMB"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_Molotov"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_AIRSTRIKE_ROCKET"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_PASSENGER_ROCKET"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_CARBINERIFLE"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_DoubleBarrelShotgun"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_SPECIALCARBINE"))
RemoveWeaponFromPed(ply, GetHashKey("WEAPON_COMBATPISTOL"))
end
end)