I’m trying to add a blacklist of items you cannot drop in darkrp, I’m not a lua coder but I’m trying, I believe this is the code (Or the only thing I could find) on the dropping in the gamemode.
function DropWeapon(ply)
local ent = ply:GetActiveWeapon()
if not ValidEntity(ent) then return "" end
if CfgVars["RestrictDrop"] == 1 then
local found = false
for k,v in pairs(CustomShipments) do
if v.entity == ent:GetClass() then
found = true
break
end
end
if not found then
Notify(ply, 1, 4, LANGUAGE.cannot_drop_weapon)
return ""
end
end
ply:DropWeapon(ent)
return ""
end
AddChatCommand("/drop", DropWeapon)
AddChatCommand("/dropweapon", DropWeapon)
AddChatCommand("/weapondrop", DropWeapon)