How could i make it so only some ranks can ignite, bodygroup
1 replies, posted
I basically want it to be Superadmin and higher can ignite bigify smallify, etc things but regular people still have it disabled, I want them to still be able to use the context menu for remove, gravity and collisions but on my server i want to drive props, I know its possible, I've seen it on a server once as i was friends with a admin and he could do it, Thanks!
DarkRP has built in configuration to disable/enable properties for all players:
Look for this table (~ Line 451 in darkrpmodification/lua/darkrp_config/settings.lua) :
GM.Config.allowedProperties = {
remover = true,
ignite = false,
extinguish = true,
keepupright = true,
gravity = true,
collision = true,
skin = true,
bodygroups = true,
}
If you want everyone to be able to use a property set it to true. If you don't want everyone to be able to use it set it to false.
DarkRP doesn't have built in functionality to restrict properties to ranks:
You're going to have to manually add checks to the gamemode
1: Remove the property you from the allowedProperties table (~Line 451 in darkrpmodification/lua/darkrp_config/settings.lua)
2: DarkRP controls properties with the GM:CanProperty function (~Line 373 of DarkRP/gamemode/modules/base/sv_gamemode_functions.lua)
function GM:CanProperty(ply, property, ent)
if self.Config.allowedProperties[property] and ent:CPPICanTool(ply, "remover") then
return true
end
if property == "persist" and ply:IsSuperAdmin() then
return true
end
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("property_disabled"))
return false -- Disabled until antiminge measure is found
end
Add another if statement similar to the persist one for the property you want to restrict to superadmin
E.g:
function GM:CanProperty(ply, property, ent)
if self.Config.allowedProperties[property] and ent:CPPICanTool(ply, "remover") then
return true
end
if property == "persist" and ply:IsSuperAdmin() then
return true
end
if property == "ignite" and ply:IsSuperAdmin() then
return true
end
DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("property_disabled"))
return false -- Disabled until antiminge measure is found
end
Sorry, you need to Log In to post a reply to this thread.