Advertisement
Guest User

Untitled

a guest
Aug 21st, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. PLUGIN.name = "PAC3 Restriction";
  2. PLUGIN.author = "Casadis";
  3. PLUGIN.desc = "Restricts PAC3 to people with permissions.";
  4.  
  5. nut.flag.add("P", "Access to PAC3.")
  6.  
  7. if (CLIENT) then
  8. function PLUGIN:PrePACEditorOpen()
  9. local client = LocalPlayer()
  10. local char = client:getChar()
  11.  
  12. print(char and char:hasFlags("P"))
  13. return char and char:hasFlags("P")
  14. end
  15. else
  16. -- Reject unauthorized PAC3 submits
  17. net.Receive("pac_submit", function(_, ply)
  18. if (!ply) then return end -- ???
  19.  
  20. if (!ply:getChar():hasFlags("P")) then
  21. ply:notifyLocalized("illegalAccess")
  22. return
  23. end
  24.  
  25. local data = pace.net.DeserializeTable()
  26. pace.HandleReceivedData(ply, data)
  27. end)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement