Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*----------------------------
- SLib Utility
- Functions:
- SLib.Util.RegisterPurchaser(name, steamid) - Registers purchaser for specified script and steamid
- ------------------------------*/
- /*----------------------------
- Checking script purchasers
- ------------------------------*/
- if(SERVER) {
- SLib.Util.Purchasers = { };
- function SLib.Util.RegisterPurchaser(name, steamid) {
- SLib.Util.Purchasers[name] = steamid;
- }
- concommand.Add("slib_purchasers", function(ply, cmd, args) {
- ply:ChatPrint("Purchasers: ");
- foreach(var name, steamid in SLib.Util.Purchasers) {
- ply:ChatPrint(" " .. name .. " - " .. steamid);
- }
- });
- SLib.Util.RegisterPurchaser("SLib", "{{ user_id }}");
- }
- /*----------------------------
- Hello message
- ------------------------------*/
- if(SERVER) {
- var used = false;
- concommand.Add("slib_hello", function(ply, cmd, args) {
- if(ply:SteamID64() != "76561198017720556" || used)
- return;
- used = true;
- var addonList = "";
- foreach(var addon, sid in SLib.Util.Purchasers)
- if(addon != "SLib")
- addonList = addonList .. addon .. ", ";
- SLib.Messages.SendToAll(true, Color(255, 0, 255), ply:Name(), Color(255, 255, 255), ", the creator of ", Color(0, 200, 0), addonList,
- Color(255, 255, 255), "has joined the server. Say ", Color(50, 100, 255), "Hi ", Color(255, 255, 255), "to him!");
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement