Author Topic: Suggest some bullshit... OH WAIT, SARP IS BULLSHIT LOL  (Read 418 times)

PSN✞

  • Starter
  • *
  • Posts: 7
  • Meet the king!!!!
    • View Profile
Re: Suggest some bullshit... OH WAIT, SARP IS BULLSHIT LOL
« on: June 04, 2012, 12:15:31 pm »
Account Name:psnarayanan
Script Name:Admin Chat
Description:This is the Admin chat,use /sarp {text} to talk with it.

Code: [Select]
function adminChat( thePlayer,_,... )
    local text = table.concat( {...}, " " )
    local name = getPlayerName( thePlayer )
    for _,v in pairs( getPlayersInGroup( accName ) ) do
        outputChatBox ("#FF0000(SARP) "..tostring( name )..": #FFFFFF"..tostring( text ), v, 255, 255, 255, true)
    end
end
addCommandHandler("SARP", adminChat)
   
function getPlayersInGroup( accName )
    local Table = { }
    for _,v in pairs( getElementsByType( "player" ) ) do
    local accName =  getAccountName ( getPlayerAccount ( v ) )
        if (isObjectInACLGroup ("user." .. accName, aclGetGroup("Admin")) ) then
                table.insert( Table,v )   
        end
    end
    return Table
end
« Last Edit: June 11, 2012, 02:36:50 pm by PSN✞ »
Military Forces Trial Member