What I'm trying to do: Remove F4 Tab "Shipments" if a player is not a certain job for example:
if !TEAM_GUN then
DarkRP.removeF4MenuTab( "Shipments" )
obviously that doesn't work so I was wondering if anyone had any suggestions?
I don't want to see it greyed out if I'm a different job, I just want it gone.
Here are all the 'no-brainer' file contents (shipment tab does still shop up) -
Only "custom" job I have:
TEAM_GUN = DarkRP.createJob("Gun Dealer2", {
color = Color(255, 140, 0, 255),
model = "models/player/monk.mdl",
description = [[A Gun Dealer is the only person who can sell guns to other people.
Make sure you aren't caught selling illegal firearms to the public! You might get arrested!]],
weapons = {},
command = "gundealer2",
max = 2,
salary = GAMEMODE.Config.normalsalary,
admin = 0,
vote = false,
hasLicense = false,
category = "Citizens",
})
Only "custom" weapon/shipment I have:
DarkRP.createShipment("AK", {
model = "models/weapons/w_rif_ak47.mdl",
entity = "weapon_ak472",
amount = 10,
price = 2500,
separate = false,
--pricesep = 0,
noship = false,
category = "Rifles",
allowed = {TEAM_GUN},
})
DarkRP Config:
DarkRP.disabledDefaults["shipments"] = {
["AK"] = true,
["AK47"] = true,
["Desert eagle"] = true,
["Fiveseven"] = true,
["Glock"] = true,
["M4"] = true,
["Mac 10"] = true,
["MP5"] = true,
["P228"] = true,
["Pump shotgun"] = true,
["Sniper rifle"] = true,
}
DarkRP Settings (anything pertaining to Shipments):
-- removeclassitems - Enable/disable shipments/microwaves/etc. removal when someone changes team.
GM.Config.removeclassitems = true
-- removeondisconnect - Enable/disable shipments/microwaves/etc. removal when someone disconnects.
GM.Config.removeondisconnect = true
-- restrictdrop - Enable/disable restricting the weapons players can drop. Setting this to true disallows weapons from shipments from being dropped.
GM.Config.restrictdrop = false
-- ShipmentSpawnTime - Antispam time between spawning shipments.
GM.Config.ShipmentSpamTime = 3
-- shipmenttime - The number of seconds it takes for a shipment to spawn.
GM.Config.shipmentspawntime
-- hide the items that you can't buy and the jobs you can't get (instead of graying them out).
-- this option hides items when you don't have enough money, when the maximum is reached for a job or any other reason.
GM.Config.hideNonBuyable = false
-- Hide only the items that you have the wrong job for (or for which the customCheck says no).
-- When you set this option to true and hideNonBuyable to false, you WILL see e.g. items that are too expensive for you to buy.
-- but you won't see gundealer shipments when you have the citizen job.
GM.Config.hideTeamUnbuyable = true
To have something dissapear from the F4 Menu during a certain Event you would need to edit the code of the F4 menu that you use, since they include the code that show you the Shipment Tab. So you have to ask the creator of that F4 menu, or edit the code yourself completley
It's not a custom F4 menu it's the default DarkRP menu.
just edited my post but it basically means the same still. Anyway:
Its the same with custom F4 menus. You have to look at the code, try to understand it, remove the Shipment tab (which will break darkrp somewhere, for sure), and then reposition everything of the menu since you would have a missing spot anyway.
And pretty much everyone on this forum will tell you (including the lua files of darkrp themselfs): DO NOT EDIT ANYTHING FROM THE DARKRP GAMEMODE ITSELF IT WILL BREAK SOMETHING
Your better off if you get a custom F4 menu
I'm editing the addon not the core files. Getting a new F4 menu seems pretty excessive for something that should be easy to disable in the Gamemode. I'm able to get the Weapons tab to disappear with these settings but not the Shipments tab and I don't know why that is.
because that feature has not been added in darkrp. weapons can be gone, shipments are a thing thats always in darkrp, so the creator didnt made a feature to remove it
I honestly feel like I'm just calling the function wrong. It can be removed if I put a similar code into a different file but I just don't know what to put in place of !TEAM_GUN.
Read the fucking messages. "The creator didnt made a feature to remove it". Unless you make your own or modify a pre-made one, there is no way you can remove it.
what?
*sigh* you CANT remove the shipment tab, because there is no feature programmed by the DarkRP creator. IF you edit the code youtself, you WILL break something else in Darkrp. And you HAVE to reposition the whole F4 menu, because otherwise it would look weird and wrong.
Short: your doing better if you just buy a F4 menu or make one by yourself
No I understand. I was just being persistent because I removed the shipment tab already.
Then fucking tell us jesus christ it's not that hard.
I did but in your haste to be rude you apparently skim read what I said:
https://imgur.com/bxcrhZA
You really have no idea how your acting here, do you? (not this thread on its own. All of your activity on the forum)
hook.Add( “F4MenuTabs”, “TabRemover”, function() if LocalPlayer():Team() ~= TEAM_GUN then DarkRP.removeF4MenuTab( "Shipments" ) end)
Typing this on a phone :P
@ButterKing5000 yeah that's roughly what I had before but for whatever reason it doesn't work for the team specifically.
Sorry, you need to Log In to post a reply to this thread.