daily pastebin goal
46%
SHARE
TWEET

Admin Messages

Chalwk77 Jan 18th, 2019 152 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. --=====================================================================================================--
  3. Script Name: Admin Join Messages, for SAPP (PC & CE)
  4. Description: Customize admin join messages on a per-admin-level basis.
  5.  
  6. Copyright (c) 2019, Jericho Crosby <jericho.crosby227@gmail.com>
  7. Notice: You can use this document subject to the following conditions:
  8. https://github.com/Chalwk77/Halo-Scripts-Phasor-V2-/blob/master/LICENSE
  9. ~ Written by Jericho Crosby (Chalwk)
  10. --=====================================================================================================--
  11. ]]--
  12. api_version = "1.11.0.0"
  13. custom_messages = {} -- do not touch!
  14.  
  15. -- Configuration [starts]
  16. -- output:            [prefix]              [message] (note: player name is automatically inserted between [prefix] and [message])
  17. custom_messages[1] = {"[TRIAL-MOD] ",       " joined the server. Everybody hide!"}
  18. custom_messages[2] = {"[MODERATOR] ",       " just showed up. Hold my beer!"}
  19. custom_messages[3] = {"[ADMIN] ",           " just joined. Hide your bananas!"}
  20. custom_messages[4] = {"[SENIOR-ADMIN] ",    " joined the server."}
  21. -- Configuration [ends]
  22.  
  23. -- do not touch below this point unless you know what you're doing
  24. function OnScriptLoad()
  25.     register_callback(cb['EVENT_JOIN'], "OnPlayerJoin")
  26. end
  27.  
  28. function OnScriptUnload()
  29.  
  30. end
  31.  
  32. function OnPlayerJoin(PlayerIndex)
  33.     local name = get_var(PlayerIndex, "$name")
  34.     local admin_level = tonumber(get_var(PlayerIndex, "$lvl"))
  35.     local join_message
  36.     if (admin_level >= 1) then
  37.         join_message = custom_messages[admin_level][1] .. name .. custom_messages[admin_level][2]
  38.     else
  39.         return false
  40.     end
  41.     announceJoin(join_message)
  42. end
  43.  
  44. function announceJoin(join_message)
  45.     for i = 1,16 do
  46.         if player_present(i) then
  47.             rprint(i, join_message)
  48.         end
  49.     end
  50. 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