1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

I need Help With My Chat Script

Discussion in 'DarkRP Modding Questions & Help' started by lDGl Shadow, Sep 14, 2017.

  1. lDGl Shadow

    lDGl Shadow New Member

    So I'm Working On A Script That Certain Jobs Can Use And View A Private Way To Communicate Or "Comms"
    I Run A MilitaryRP Server And I'm Trying To Make A System Where A Certain Faction Can Communicate Without Other Faction Metagaming, I Still Fail To Make This And Make It Say This " /us *Name* [USComms] (Message) " I'm trying to get it to work I put it in this location garrysmod/addons/darkrpmodification/lua/darkrp_modules/uscomms/sv_uscomms.lua

    Plz help



    Code (Text):

    function UsComms(ply, args)
        if args == "" then
            DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))

            return ""
        end

        local DoSay = function(text)
            if text == "" then
                DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))

                return
            end

            local teams = {TEAM_USARMYHEAVY, TEAM_USARMYSOLDIER, TEAM_USARMYMEDIC, TEAM_USARMYOFFICER, TEAM_USARMYSNIPER, TEAM_USARMYDRILLSGT, TEAM_AIRFORCESOLDIER, TEAM_AIRFORCEOFFICER, TEAM_USMARINESOLDIER, TEAM_USMARINESNIPER, TEAM_USMARINEMEDIC, TEAM_USMARINEOFFICER, TEAM_RANGEROFFICER, TEAM_RANGERSNIPER, TEAM_RANGERTACTICAL, TEAM_MILITARYPOLICE, TEAM_MILITARYPOLICEOFFICER, TEAM_RANGERMEDIC, TEAM_NAVYSEALSOLDIER, TEAM_NAVYSEALSNIPER, TEAM_NAVYSEALOFFICER, TEAM_NAVYSEALMEDIC, TEAM_DELTAFORCESOLDIER, TEAM_DELTAFORCEOFFICER, TEAM_DELTAFORCESNIPER, TEAM_DELTAFORCEMEDIC, TEAM_SPECIALFORCE, TEAM_SPECIALFORCENIPER, TEAM_SPECIALFORCEOFFICER, TEAM_SPECIALFORCEMEDIC, TEAM_AIRBORNEOFFICER, TEAM_AIRBORNEINFANTRY, TEAM_AIRBORNEMEDIC}

            for k, v in pairs(player.GetAll()) do
                if table.HasValue(teams, v:Team()) then
                    DarkRP.talkToPerson(v, col, "[UsComms] " .. ply:Nick(), Color(0, 200, 255, 255), text, ply)
                end
            end

            return args, DoSay
        end

        DarkRP.defineChatCommand("/us", Radio, 1.5)
    end
     
     
    Last edited: Sep 14, 2017
  2. -A2-

    -A2- New Member

    Please post it in pastebin or use the [ code ] tags
     
  3. lDGl Shadow

    lDGl Shadow New Member

    I've Done So.
     

Share This Page