Advertisement
Prior_

Untitled

Oct 6th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. local tems = {}
  2. tems.imperialt = {}
  3. tems.imperialt["TEAM_IMPERIALLOGISTICSDIVISION"] = true
  4. tems.imperialt["TEAM_IMPERIALMILITARYINTELLIGENCESERVICE"] = true
  5. tems.imperialt["TEAM_IMPERIALMILITARYSECURITY"] = true
  6. tems.imperialt["TEAM_IMPERIALNAVY"] = true
  7. tems.imperialt["TEAM_IMPERIALRECONAISSANCECORPS"] = true
  8. tems.imperialt["TEAM_ARMOUREDSTORMTROOPERCORPS"] = true
  9. tems.imperialt["TEAM_STORMTROOPERS"] = true
  10.  
  11. tems.rebelt = {}
  12. tems.rebelt["TEAM_REBELINSURGENTDIVISION"] = true
  13. tems.rebelt["TEAM_REBELINTELLIGENCE"]= true
  14. tems.rebelt["TEAM_REBELRECONAISSANCECORPS"]= true
  15. tems.rebelt["TEAM_REBELSPECIALFORCES"]= true
  16. tems.rebelt["TEAM_REBELSPECTREDIVISION"] = true
  17. tems.rebelt["TEAM_REBELSUPPORTCORPS"]= true
  18. tems.rebelt["TEAM_REBELWOOKIEINSURGENTS"] = true
  19. tems.rebelt["TEAM_KOTA'SMILITIA"] = true
  20.  
  21. local staff = {}
  22. staff["moderator"] = true
  23. staff["admin"] = true
  24. staff["superadmin"] = true
  25. staff["eventstaff"] = true
  26.  
  27. function playerAdvertI( ply, args )
  28. local tem = ply:Team()
  29. if !(tems.imperialt[tem] or staff[ply:GetUserGroup()]) then
  30. ply:SendLua( string.format( [[notification.AddLegacy( "%s", 1, 5 )
  31. surface.PlaySound( "buttons/button15.wav" )]], "You cannot talk in this frequency." ) )
  32. return ""
  33. end
  34.  
  35. if args == "" then
  36. ply:SendLua( string.format( [[notification.AddLegacy( "%s", 1, 5 )
  37. surface.PlaySound( "buttons/button15.wav" )]], cumms.imp.fail ) )
  38. else
  39. for k,v in pairs(player.GetAll()) do
  40. if (tems.imperialt[tem] or staff[v:GetUserGroup()]) then
  41. DarkRP.talkToPerson( v, Color(255, 0, 0), cumms.imp.prefix.." "..ply:Nick(), cumms.rebel.col, args, ply )
  42. end
  43. end
  44. return ""
  45. end
  46.  
  47. end
  48.  
  49. function playerAdvertR( ply, args )
  50. local tem = ply:Team()
  51. if !(tems.rebelt[tem] or staff[ply:GetUserGroup()]) then
  52. ply:SendLua( string.format( [[notification.AddLegacy( "%s", 1, 5 )
  53. surface.PlaySound( "buttons/button15.wav" )]], "You cannot talk in this frequency." ) )
  54. return ""
  55. end
  56.  
  57. if args == "" then
  58. ply:SendLua( string.format( [[notification.AddLegacy( "%s", 1, 5 )
  59. surface.PlaySound( "buttons/button15.wav" )]], cumms.rebel.fail ) )
  60. else
  61. for k,v in pairs(player.GetAll()) do
  62. if (tems.rebelt[tem] or staff[v:GetUserGroup()]) then
  63. DarkRP.talkToPerson( v, Color(255, 0, 0), cumms.rebel.prefix.." "..ply:Nick(), cumms.rebel.col, args, ply )
  64. end
  65. end
  66. return ""
  67. end
  68.  
  69. end
  70.  
  71. DarkRP.defineChatCommand( "icomms", playerAdvertI )
  72. DarkRP.defineChatCommand( "rcomms", playerAdvertR )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement