Advertisement
AnonGaming

ulxHooking

Jan 17th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. function ZarpUlxHooks.setupHooks()
  2.    
  3.     local ulxCommands = ulx.cmdsByCategory
  4.     for k,cat in pairs(ulxCommands) do
  5.         for k,cmd in pairs(cat) do
  6.             local oldFm = cmd.fn
  7.             local cmdNam = string.Replace(cmd.cmd, " ","")
  8.             cmd.fn = function(...)
  9.                 hook.Call(cmdNam,nil,...)
  10.                 return oldFm(...)
  11.             end
  12.        
  13.         end
  14.     end
  15.    
  16.     ulx.cmdsByCategory = ulxCommands
  17. end
  18.  
  19. hook.Add("ulxadduserid", "timekeepulxadduserid", function(calling_ply,id,group)
  20.                 if not checkForValidId( calling_ply, id ) then return false end
  21.                 zarpTime.setPlayerTimeRank(id,group)
  22.             end)
  23.            
  24.             hook.Add("ulxremoveuserid", "timekeepulxremoveuserid", function(calling_ply,id)
  25.                 if not checkForValidId( calling_ply, id ) then return false end
  26.                 zarpTime.setPlayerTimeRank(id,"user")
  27.             end)
  28.            
  29.            
  30.             hook.Add("ulxadduser", "timekeepulxadduser", function(calling_ply,target_ply,group_name)
  31.                 zarpTime.setPlayerTimeRank(target_ply:SteamID(),group_name)
  32.             end)
  33.            
  34.             hook.Add("ulxremoveuser", "timekeepulxremoveuser", function(calling_ply,target_ply)
  35.                 zarpTime.setPlayerTimeRank(target_ply:SteamID(),"user")
  36.             end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement