ULX

Poll

Good idea ?

<censor> Yea Will Be Usefull
9 (60%)
Yea
6 (40%)
Maybe
0 (0%)
Not sure
0 (0%)
No
0 (0%)

Total Members Voted: 15

Author Topic: ULXToolRestricter  (Read 9517 times)

0 Members and 1 Guest are viewing this topic.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: ULXToolRestricter
« Reply #15 on: July 09, 2008, 02:00:50 AM »
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: [Select]
-- 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 );

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 :))
« Last Edit: July 09, 2008, 02:04:56 AM by Kyzer »

Offline RecoX

  • Newbie
  • *
  • Posts: 18
  • Karma: 4
  • Hey, Yea im not the best at lua but im lerning
Re: ULXToolRestricter
« Reply #16 on: July 10, 2008, 10:59:18 AM »
Aggred, This is one of my 1st projects for ulx im tired of having to think if i install this minges will abuse it

Reco Will Allways Help!

Offline RecoX

  • Newbie
  • *
  • Posts: 18
  • Karma: 4
  • Hey, Yea im not the best at lua but im lerning
Re: ULXToolRestricter
« Reply #17 on: July 10, 2008, 12:10:00 PM »
Well it dosn't seem to bother checking what tool is open theres no errors nothing

Reco Will Allways Help!