Forum

> > CS2D > Scripts > Server info menu!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Server info menu!

7 replies
To the start Previous 1 Next To the start

old Server info menu!

Black Wolf
User Off Offline

Quote
How do i can make script like when you say !info2 then there opens menu like menu what open when you join to game with text (server info.txt).

old Re: Server info menu!

EndDead
User Off Offline

Quote
Use the serveraction hook/function to act one or two or whatever and add a menu, Like:
1
2
3
4
5
6
addhook("serveraction","infomenu")
function infomenu(id,act)
     if act==1 then
          menu(id,"Info Menu,Help,Help 2,Help 3, Etc")
     end
end

Then give each button an info that sends a message to the player, for example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("menu","infomenu")
function buymenu(id,title,buton)
if title=="Info Menu" then
if buton==1 then
		msg2(id,"©000255000Press space to jump!@C")
end
elseif buton==2 then
		msg2(id,"©000255000Server owner is Voyaflexel!@C")
end
elseif buton==3 then
		msg2(id,"©000255000Our site is: Example.com@C")
end
elseif buton==4 then
		msg2(id,"©000255000LoL!@C")
end
end
end
end

PS. code not tested, Good luck.

old Re: Server info menu!

Suprise
BANNED Off Offline

Quote
1
2
3
4
5
6
addhook("say","tsay")
function tsay(id,txt)
	if txt=="!info2" then
		parse("serverinfo")
	end
end
should work

old Re: Server info menu!

Black Wolf
User Off Offline

Quote
user Suprise has written
1
2
3
4
5
6
addhook("say","tsay")
function tsay(id,txt)
	if txt=="!info2" then
		parse("serverinfo")
	end
end
should work


I don't want open server info i want open menu what looks like server info menu where i can put text

old Re: Server info menu!

EndDead
User Off Offline

Quote
user Black Wolf has written
Thx, but i mean the menu where are only text like server info...


I think no way, but you still can do something like it, by:
changeing what i gave you from a msg into a hud text or a hud picture. good luck.

old Re: Server info menu!

Happy eyes
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
funcion infomenu(id)
     local m = "Serverinfo@b,"
     local file = io.open("sys/serverinfo.txt","r")
     for line in file:lines() do
          m=m..line..","
     end
     menu(id,m)
end

addhook('say','say')
function say(id,text)
     if text:lower() == '!info2' then
          infomenu(id)
     end
end

Not tested code (sorry for no tabs, Im not sure how to add them on android system), I hope you understand the logic, however you may need several pages of menus because this code can only show you 9 lines of serverinfo.txt
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview