Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Radio Commands for Deathmatch Mode
#1
Bug 
Code:
function array(m, h)
     local d = {}
     for a = 1, m do
          d[a] = h
     end
return d
end

secs = array(32,0)
cooldown = 3 --to prevent command spam

radio = {}

--[[            Z Radio            ]]--
radio[6] = {"radio/coverme.ogg","Cover me!"}
radio[32] = {"radio/takepoint.ogg", "You take the point"}
radio[23] = {"radio/position.ogg","Hold this position!"}
radio[24] = {"radio/regroup.ogg","Regroup team!"}
radio[13] = {"radio/followme.ogg","Follow me!"}
radio[11] = {"radio/fireassis.ogg","Taking fire, need assistance!"}

--[[            X Radio            ]]--
radio[15] = {"radio/go.ogg","Go go go!"}
radio[10] = {"radio/fallback.ogg","Team fall back"}
radio[30] = {"radio/sticktog.ogg","Stick together team"}
radio[14] = {"radio/getinpos.ogg","Get in position and wait for my go!"}
radio[31] = {"radio/stormfront.ogg","Storm in the front!"}
radio[25] = {"radio/reportin.ogg","Report in, team!"}

--[[            C Radio            ]]--
radio[0] = {"radio/roger.ogg","Roger that!"}
radio[28] = {"radio/affirm.ogg","Affirmative!"}
radio[9] = {"radio/enemys.ogg","Enemy spotted!"}
radio[1] = {"radio/backup.ogg","Need backup!"}
radio[5] = {"radio/clear.ogg","Sector clear!"}
radio[17] = {"radio/inpos.ogg","I'm in position!"}
radio[26] = {"radio/reportingin.ogg","Reporting in!"}
radio[2] = {"radio/blow.ogg","Get out of there she's gonna blow!"}
radio[22] = {"radio/negative.ogg","Negative!"}
radio[8] = {"radio/enemydown.ogg","Enemy down!"}

addhook("radio","_radio")
function _radio(id,m)
     --msg(m)
     if secs[id] == 0 then
          parse("sv_sound "..radio[m][1].."")
          secs[id]= cooldown
          if player(id,"team") == 1 then
          msg("\169255025000"..player(id,"name").." \169255220000(Radio): "..radio[m][2].."")
          elseif player(id,"team") == 2 then
          msg("\169050150255"..player(id,"name").." \169255220000(Radio): "..radio[m][2].."")
          end
     end
end

addhook("second","second_hook")
function second_hook()
     for id = 1, 32 do
          if secs[id] ~= 0 then
               secs[id] = secs[id] - 1
               --msg(secs[id])
          end
     end
end
[Image: bcy.jpg]

- United we stand, divided we fall. -
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Bug Blocking Radio Menus by Server-side BcY 2 916 16-08-2018, 07:53 PM
Last Post: BcY

Forum Jump:


Users browsing this thread: 1 Guest(s)