Forum

> > CS2D > Scripts > Add news cmd in hc admin script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Add news cmd in hc admin script

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Add news cmd in hc admin script

eledah
User Off Offline

Zitieren
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

alt Re: Add news cmd in hc admin script

eledah
User Off Offline

Zitieren
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 >

alt Re: Add news cmd in hc admin script

Kirito2K
User Off Offline

Zitieren
@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 .

alt Re: Add news cmd in hc admin script

eledah
User Off Offline

Zitieren
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")
1× editiert, zuletzt 23.12.14 17:46:44
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht