Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement