General > Developers Corner
ULXToolRestricter
Chironex:
There is more problems, such as using sometimes 'ply', and sometimes 'pl'...and the 'end's being at a wrong place
Try that (i can't test..):
--- Code: ----- Add your restrected tools here
local Restricted_Tools =
{
"#Anti-NoClip",
"adv_duplicator",
"Gcombat",
"Anti-NoClip",
"linktool",
"stacker",
}
--Add your steam id's that this should not affect
local Allowed_players =
{
"STEAM:1:0:5447",
}
function gettool(ply, tr, toolmode)
if Restricted_Tools[toolmode] then
if not ply:IsAdmin() and not Allowed_players[ply:SteamID()] then
ply:PrintMessage(HUD_PRINTTALK, "ULXAnti-Stool: Sorry but you are not allowed to use this STool !! Complain to the admins :)")
return false
end
end
end
hook.Add( "CanTool", "GetTool", gettool)
-- what is that? need the function UseTool : hook.Add( "CanTool", "UseTool", UseTool );
--- End code ---
Also you may need to add commands for admins to add/remove steamids and stools dynamically (and so need some file manipulations to save/read tables - not hard).
Once you get it working perfectly, you can release it as a module :) (because actually, it's more a not working snippet :))
RecoX:
Aggred, This is one of my 1st projects for ulx im tired of having to think if i install this minges will abuse it
RecoX:
Well it dosn't seem to bother checking what tool is open theres no errors nothing
Navigation
[0] Message Index
[*] Previous page
Go to full version