PivityGmodStore

Restricting entities to certain jobs and donators

If you want to restrict entities to certain jobs, here is an example:

DarkRP.createEntity("Solar Panel", {
ent = "ch_bitminer_power_solar",
model = "models/craphead_scripts/bitminers/power/solar_panel.mdl",
price = 3000,
max = 2,
category = "Bitminer Equipment",
cmd = "buysolarpanel",
allowed = {TEAM_DRUGGIE, TEAM_GANGSTER, TEAM_WHATEVER},
})


You can read more about customizing entities in the DarkRP Wiki (CustomEntityFields)

Here is another example of how to make an item only available for donators.

DarkRP.createEntity("Cooling Upgrade 3", {
ent = "ch_bitminer_upgrade_cooling3",
model = "models/craphead_scripts/bitminers/utility/cooling_upgrade_3.mdl",
price = 5000,
max = 10,
category = "Bitminer Equipment",
cmd = "buycooling3",
customCheck = function(ply) return ply:GetUserGroup() == "donator" end,
CustomCheckFailMsg = function(ply, entTable) return "You need to be a donator to buy this entity!" end,
})


Hope this helps you!

Can't find what you're looking for?

Contact support