Hello - I am just wanting to simply remove useless/permission restricted tools from users sight just to make it more clean looking. I have so far got to the directory of all the stools but I only have a rough idea of how to check if admin etc... this is what I have got so far:
[CODE]customCheck = function(ply) return ply:GetUserGroup() = "superadmin" end,
TOOL.Category = "Constraints"
TOOL.Name = "#tool.winch.name"
TOOL.ClientConVar[ "rope_material" ] = "cable/rope"
TOOL.ClientConVar[ "rope_width" ] = "3"
TOOL.ClientConVar[ "fwd_speed" ] = "64"
TOOL.ClientConVar[ "bwd_speed" ] = "64"
TOOL.ClientConVar[ "fwd_group" ] = "44"
TOOL.ClientConVar[ "bwd_group" ] = "41"
rest of winch code...[/CODE]
Thanks for any help.
There are no restricted tools in Garry's Mod. What you did for getting restricted tools?
Are you running a admin/permission mod or unofficial stools addons?
Why run customCheck as a function when you can just do it as a variable
[CODE]customCheck = function(ply) return ply:GetUserGroup() == "superadmin" end
instead of
customCheck = ply:GetUserGroup() == "superadmin"
[/CODE]
I [b]might[/b] be going on a limb, as there is really not much documentation to go on, but try this:
[code]
if customCheck then
TOOL.Category = "Constraints"
TOOL.Name = "#tool.winch.name"
end
[/code]
Pretty sure tools are shared files, with those lines being clientside-only. Not sure.
[QUOTE=ScarehGhoost;49167922]Why run customCheck as a function when you can just do it as a variable
[CODE]customCheck = function(ply) return ply:GetUserGroup() == "superadmin" end
instead of
customCheck = ply:GetUserGroup() == "superadmin"
[/CODE][/QUOTE]
He 100% copied it from a darkrp job, look at the comma at the end
You can't use GetUserGroup until the player has initially spawned and by then the tool is already added to the spawn menu list. You need to remove the tools from the spawn menu when they open it for the first time.
[QUOTE=thegrb93;49169206]You can't use GetUserGroup until the player has initially spawned and by then the tool is already added to the spawn menu list. You need to remove the tools from the spawn menu when they open it for the first time.[/QUOTE]
Or just return in the PrimaryFire function or how it is callwd if player is not an admin
[QUOTE=ScarehGhoost;49167922]Why run customCheck as a function when you can just do it as a variable
[CODE]customCheck = function(ply) return ply:GetUserGroup() == "superadmin" end
instead of
customCheck = ply:GetUserGroup() == "superadmin"
[/CODE][/QUOTE]
Sorry; I copied this from elsewhere.
[editline]23rd November 2015[/editline]
[QUOTE=tzahush;49168891]He 100% copied it from a darkrp job, look at the comma at the end[/QUOTE]
Did not deny it haha, just put 2 and 2 together and gave it a go, jeez.
[QUOTE=geferon;49171241]Or just return in the PrimaryFire function or how it is callwd if player is not an admin[/QUOTE]
He wants to remove it from the spawn menu.
Sorry, you need to Log In to post a reply to this thread.