So ive made a new class for DarkRP, called an electrician.
[quote]TEAM_ELECTRICIAN = AddExtraTeam("Electrician", Color(80, 80, 0, 255), "models/player/hostage/hostage_04.mdl", [[Use wiremod+pctools.]],
{}, "electrician", 2, 50, 0, false)[/quote]
I want this to be the ONLY class to be able to use wiremod and pctools, does anyone know how i would go about this.
[lua] function WireRestriction( ply, tr, toolmode )
if string.find(toolmode, "wire") then
if ply:Team() == TEAM_ELECTRICIAN then -- add or ply:IsAdmin() if you want admins to be able to use them anyway
return true
else
return false
end
end
end
hook.Add( "CanTool", "WireRestriction", WireRestriction)[/lua]
Not tested but that should work.
[QUOTE=Crazy Quebec;17929961][lua] function WireRestriction( ply, tr, toolmode )
if string.find(toolmode, "wire") then
if ply:Team() == TEAM_ELECTRICIAN then -- add or ply:IsAdmin() if you want admins to be able to use them anyway
return true
else
return false
end
end
end
hook.Add( "CanTool", "WireRestriction", WireRestriction)[/lua]
Not tested but that should work.[/QUOTE]
Thanks for quick response, but where do i add this to. Im not very good at all with lua.
Anywhere serverside. So it could be at the end of the init/main.lua of your DarkRP, or just in garrysmod/lua/autorun/NameMe.lua
To save as lua just use notepad and save as .lua
[QUOTE=Crazy Quebec;17930062]Anywhere serverside. So it could be at the end of the init/main.lua of your DarkRP, or just in garrysmod/lua/autorun/NameMe.lua
To save as lua just use notepad and save as .lua[/QUOTE]
Thanks works perfectly. Is it possible to block the physics panel in wiremod completely though.
[editline]06:24PM[/editline]
[QUOTE=Puni;17930252]Thanks works perfectly. Is it possible to block the physics panel in wiremod completely though.[/QUOTE]
And how about the PCTools as well.
[editline]08:08PM[/editline]
Ye i really need the physics panel blocked out, because people just kill eachother.
Also, if its possible it would be great to have a a way of giving the contraptions made to someone else because if this class leaves we dont want the stuff he has made for someone else do dissapear.
Sorry, you need to Log In to post a reply to this thread.