Forum

> > CS2D > Scripts > Add news cmd in hc admin script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Add news cmd in hc admin script

7 replies
To the start Previous 1 Next To the start

old Re: Add news cmd in hc admin script

eledah
User Off Offline

Quote
Change his entire script to a function (addNews(msg)), then use this
1
2
3
4
5
6
-- Put this one inside "function hc.moderation.init()", moderation.lua
hc.add_say_command("news", hc.moderation.news_say_command, hc.MODERATOR2, "[<message>]", "Displays a news")
-- Then put this one right under that function
function hc.moderation.news_say_command(p, arg)
  addNews(arg)
end

old Re: Add news cmd in hc admin script

eledah
User Off Offline

Quote
Add this one to 'function hc.moderation.init()'
1
hc.add_say_command("news", hc.moderation.news_say_command, hc.MODERATOR2, "<message>", "Displays a news")
Put right below that function I told you about
Spoiler >

old Re: Add news cmd in hc admin script

Kirito2K
User Off Offline

Quote
@user eledah: The script doesn't work , the problem is when "any player" write "any thing" the thing he wrote , will be a news .

Example : i opened a server and wrote "LOOOOL" The news bar just wrote "LOOOL" . I hope you understand meh .

old Re: Add news cmd in hc admin script

eledah
User Off Offline

Quote
Sorry, my bad. Remove these lines from your code and it'll work fine.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function News.Load_Tlex()
     if not v_TLex_path then
          addhook("say","News.Say",1)
          local tab = {}
          for k,v in pairs(News.Admin_List) do
               tab[tostring(v)] = true
          end
          News.Admin_List = tab
     else
          t_commands["news"] = {"@","news",News.Tlex_Rank,News.Delay,99,1,"News.Counter==0","Error: You can't use this command at the moment.","News.Main('@news '..v_argsall) News.Counter = News.Delay","@news <message>",1}
     end
end
     
timer(100,"News.Load_Tlex")
edited 1×, last 23.12.14 05:46:44 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview