SHARE
TWEET

Untitled

a guest Dec 15th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- When a client joins
  2. function Admin:OnUserJoin(user)
  3.     -- Get their rank from the database.
  4.     -- If they don't have one, we're not gonna do anything.
  5.     SQL:Prepare("SELECT * FROM game_ranks WHERE steamid = {0}", {user:SteamID()}
  6.     ):Execute(function(data, args, err)
  7.         if (data) then
  8.             Admin:SetUserRank(user, data[1].rank)
  9.         end
  10.     end)
  11.  
  12.     -- Are they gagged
  13.     local gagged = user:GetPData("is_gagged", 0)
  14.     if (tonumber(gagged) == 1) then
  15.         user.gagged = true
  16.         Admin:Print(false, "Player ", AC, user:Name(), CW, " joined with a permanent gag and therefore was gagged.")
  17.     end
  18.  
  19.     -- Are they muted
  20.     local muted = user:GetPData("is_muted", 0)
  21.     if (tonumber(muted) == 1) then
  22.         user.muted = true
  23.         Admin:Print(false, "Player ", AC, user:Name(), CW, " joined with a permanent mute and therefore was muted.")
  24.     end
  25.  
  26.     -- Everyone network everywhere!
  27.     for k, v in pairs(player.GetHumans()) do
  28.         if not IsValid(v) or (v == user) then continue end
  29.         self:NetworkUserRank(v)
  30.     end
  31.  
  32.     JAC:StartDataAnalysis(user, false, 0.54)
  33. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top