Prior_

Untitled

Jan 9th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. function playerAdvert( ply, args )
  2.  
  3.     if args == "" then
  4.  
  5.         ply:SendLua( string.format( [[notification.AddLegacy( "%s", 1, 5 )
  6.             surface.PlaySound( "buttons/button15.wav" )]], ENEMYCOMMS.failMessage ) )
  7.  
  8.     elseif team.GetName(ply:Team() != "Enemy") then
  9.         ply:SendLua( string.format( [[notification.AddLegacy( "%s", 1, 5 )
  10.             surface.PlaySound( "buttons/button15.wav" )]], ENEMYCOMMS.failMessage2 ) )
  11.         return ""
  12.     else
  13.         for k,pl in pairs( player.GetAll() ) do
  14.  
  15.             local senderColor = team.GetColor( ply:Team() )
  16.             DarkRP.talkToPerson( pl, senderColor, ENEMYCOMMS.chatPrefix.." "..ply:Nick(), ENEMYCOMMS.advertTextColor, args, ply )
  17.  
  18.         end
  19.  
  20.         return ""
  21.  
  22.     end
  23.  
  24. end
  25. DarkRP.defineChatCommand( ENEMYCOMMS.chatCommand, playerAdvert )
Advertisement
Add Comment
Please, Sign In to add comment