▸customHideUnavail

Forces an entity to not show in the F4 menu if CustomCheck is provided and the player does not meet the requirements.

Alias

customHideUnavail, bHideUnavail

Source

added in Arivia v3

Requires

entity must have valid CustomCheck

Type

boolean ( true, false )

Info

Arivia includes a setting called cfg.tabs.entities.bHideUnavail within lua\modules\arivia\cfg\sh_4_tabs.lua which makes entities appear in the F4 menu as faded if the player is not allowed to buy them.

If you wish to keep that on, however, hide entities that you've supplied CustomChecks for; and wish for those specific items to not show at all if the player cannot afford them, you can provide the customHideUnavail field to each entity.

If customHideUnavail is provided for an item; it will ONLY appear in the F4 menu if the player should be able to buy it.

Example

DarkRP.createEntity( 'Acetone',
{
	ent 			        = 'bp_chemical_acet2',
	model 			      = 'models/blues_pharm/jar_3.mdl',
	price 			      = 750,
	max 			        = 2,
	cmd 			        = 'bpbuyacet',
	category 		      = 'Blue\'s Pharmaceuticals',
	customHideUnavail = true,
	customCheck = function( ply ) return
		table.HasValue( { TEAM_Pharmaceutica }, ply:Team( ) )
	end,
	CustomCheckFailMsg = 'Must be a Pharmacist',
} )

If you wish to hide entities all-together when they are not purchasable; open lua\modules\arivia\cfg\sh_4_tabs.lua and set cfg.tabs.entities.bHideUnavail = true

Notes

An alternative to using customHideUnavail + CustomCheck is to use allowed instead.

DarkRP.createEntity( 'Acetone',
{
	ent 			  = 'bp_chemical_acet2',
	model 			= 'models/blues_pharm/jar_3.mdl',
	price 			= 750,
	max 			  = 2,
	cmd 			  = 'bpbuyacet',
	category 		= 'Blue\'s Pharmaceuticals',
	allowed			= { TEAM_Pharmaceutica },
} )

Last updated