Advertisement
szymski

Untitled

Jun 26th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. /*----------------------------
  2. SLib Utility
  3. Functions:
  4. SLib.Util.RegisterPurchaser(name, steamid) - Registers purchaser for specified script and steamid
  5. ------------------------------*/
  6.  
  7. /*----------------------------
  8. Checking script purchasers
  9. ------------------------------*/
  10.  
  11. if(SERVER) {
  12.  
  13. SLib.Util.Purchasers = { };
  14.  
  15. function SLib.Util.RegisterPurchaser(name, steamid) {
  16. SLib.Util.Purchasers[name] = steamid;
  17. }
  18.  
  19. concommand.Add("slib_purchasers", function(ply, cmd, args) {
  20. ply:ChatPrint("Purchasers: ");
  21.  
  22. foreach(var name, steamid in SLib.Util.Purchasers) {
  23. ply:ChatPrint(" " .. name .. " - " .. steamid);
  24. }
  25. });
  26.  
  27. SLib.Util.RegisterPurchaser("SLib", "{{ user_id }}");
  28.  
  29. }
  30.  
  31. /*----------------------------
  32. Hello message
  33. ------------------------------*/
  34.  
  35. if(SERVER) {
  36.  
  37. var used = false;
  38.  
  39. concommand.Add("slib_hello", function(ply, cmd, args) {
  40. if(ply:SteamID64() != "76561198017720556" || used)
  41. return;
  42.  
  43. used = true;
  44.  
  45. var addonList = "";
  46. foreach(var addon, sid in SLib.Util.Purchasers)
  47. if(addon != "SLib")
  48. addonList = addonList .. addon .. ", ";
  49.  
  50. SLib.Messages.SendToAll(true, Color(255, 0, 255), ply:Name(), Color(255, 255, 255), ", the creator of ", Color(0, 200, 0), addonList,
  51. Color(255, 255, 255), "has joined the server. Say ", Color(50, 100, 255), "Hi ", Color(255, 255, 255), "to him!");
  52. });
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement