SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function PlyStoreWeapons(ply)
  2. hook.Add("canChangeJob", "dontchangejobIfstored", function(plyr)
  3. if plyr == ply then return false end
  4.    
  5. end)
  6.         ply.storeweps = {}
  7.         for k,v in pairs(ply:GetWeapons()) do
  8.             table.insert(ply.storeweps, {cl = v:GetClass(), c1 = v:Clip1(), c2 = v:Clip2()})
  9. --          print( v:GetClass() )
  10.         end
  11.     end
  12.  
  13.         function PlyRetrieveWeapons(ply)
  14.         hook.Remove("canChangeJob", "dontchangejobIfstored")
  15.         for k,v in pairs(ply.storeweps or {}) do
  16. --          print( v.cl )
  17.             ply:Give(v.cl)
  18.             local wep = ply:GetWeapon(v.cl)
  19.             if IsValid(wep) then
  20.                 wep:SetClip1(v.c1)
  21.                 wep:SetClip2(v.c2)
  22.             end
  23.         end
  24.     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
 
Top