Advertisement
AnonGaming

ulxCommandHooks

Dec 15th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. function hasUlx()
  2.     if ulx then
  3.         return true
  4.     else
  5.         return false
  6.     end
  7. end
  8.  
  9. function setupUlxHooks()
  10.     local ulxCommands = ulx.cmdsByCategory
  11.     for k,cat in pairs(ulxCommands) do
  12.         for k,cmd in pairs(cat) do
  13.             local oldFm = cmd.fn
  14.             local cmdNam = string.Replace(cmd.cmd, " ","")
  15.             cmd.fn = function(...)
  16.                 hook.Call(cmdNam,nil,...)
  17.                 return oldFm(...)
  18.             end
  19.        
  20.         end
  21.     end
  22.    
  23.     ulx.cmdsByCategory = ulxCommands
  24. end
  25.  
  26.  
  27. /*
  28. Hook Syntax
  29. arg1: (command) eg ulxadduserid or ulxremoveuser
  30. arg2: hook name
  31. arg3 function(normal ulx outputs)
  32.  
  33. */
  34. hook.Add("ulxremoveuser", "timekeepulxremoveuser", function(calling_ply,target_ply)
  35.     //Code Goes here
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement