General > Developers Corner

ULXToolRestricter

<< < (2/4) > >>

Chironex:
Do something more newb-friendly, something like that:

--- Code: ----- Here they write all tools they want to restrict:
local Restricted_Tools =
{
    "#Anti-NoClip",
    "Gcombat",
    "Cannon",
    "linktool"
}

--and then in your function, you just check if the toolmode is one of that list:
if Restricted_Tools[toolmode] then

--- End code ---

RecoX:
Thanks Medigeo (hopfly spelt right didn't look) And ill try to make something more newb friendly

RecoX:
Ive Added the Nweb Freindly stool adder and im also working on allowed players via steam ids is it ply:SteamID() ?

jay209015:
The hook needs to be after the function


--- Code: ---hook.Add( "CanTool", "GetTool", gettool)
--- End code ---

This will only work for the first table entry:


--- Code: ---if ply:SteamID() == Allowed_players then return true
--- End code ---

Try something like:


--- Code: ---table.HasValue(Allowed_players, ply:SteamID()) then return true
--- End code ---

And where's the function "UseTool" that you are calling with this hook?


--- Code: ---hook.Add( "CanTool", "UseTool", UseTool );
--- End code ---

RecoX:
Well getting that it wont checkif your amdin when you slect a tool maybe ill try if you use a tool thats restricted without being an admin

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version