Forum

> > CS2D > Scripts > [Menu] Type's
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch [Menu] Type's

14 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: [Menu] Type's

Happy eyes
User Off Offline

Zitieren
You need a blank image of that sub menu, then you have to add image every time when player opens menu, and delete image when player closes menu (use HUD mode on image).
Also you need to do same with hudtxt lines, to add text (add text when menu is opened, and delete text when menu is closed) Commands you will need is cs2d lua cmd image and cs2d cmd hudtxt

alt Re: [Menu] Type's

Suprise
BANNED Off Offline

Zitieren
I have one. If you need it, use it.
IMG:https://i30.servimg.com/u/f30/17/30/54/57/start_10.jpg

I created this for my mod, but since I can't use image correctly, I don't need it.

alt Re: [Menu] Type's

Avo
User Off Offline

Zitieren
@user Jhony: use image function and hudtxt command to write text over it. And advice for the future: do not comment files like "0/-0" .

alt Re: [Menu] Type's

Suprise
BANNED Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function Array(size,value)
	local array = {}
	for i = 1, size do
		array[i] = value
	end
	return array
end

news_image = Array(32,0)

imagepath = "gfx/start" -- Your image! 

locked={}
	
addhook("serveraction","_action")
function _action(id,action)
	if action == 1 then
		if locked[id]==true then
			menu(id,"Player menu,(News),News off")
		else
			menu(id,"Player menu,News,(News off)")
		end
	end
end

addhook("menu","_menu")
function _menu(id,title,button)
	if title == "Player menu" then
		if button == 1 then
			if locked[id]==nil or locked[id]==false then
				locked[id]=true
				news_image[id] = image(imagepath..".bmp",440,80,2,source)
				parse('hudtxt2 '..id..' 1 "©255255255Today news!" 400 23') --Add more texts! This show only the title! If you need help with it PM me.
			end
		elseif button == 2 then
			if locked[id]==true then
				locked[id]=false
				freeimage(news_image[id])
				parse('hudtxt2 '..id..' 1 "" 400 23')
			end
		end
	end
end

alt Re: [Menu] Type's

Jhony
User Off Offline

Zitieren
Ok '-'
But How to Position Images and Texts, Do not Know the Numbers of Positions
I want to learn the positions of images and texts

alt Re: [Menu] Type's

Gaios
Reviewer Off Offline

Zitieren
user Jhony hat geschrieben
Ok '-'
But How to Position Images and Texts, Do not Know the Numbers of Positions
I want to learn the positions of images and texts


You must change script, line:
1
2
news_image[id] = image(imagepath..".bmp",440,80,2,source)
parse('hudtxt2 '..id..' 1 "©255255255Today news!" 400 23') --Add more texts!
Change:
440 80 x and y image
400 23 x and y text

alt Re: [Menu] Type's

Jhony
User Off Offline

Zitieren
@user Gaios: I Want to Learn them Positions
Example: Putting the picture in Half
Example: Putting the picture below

I do not know the Codes of Positions
There is a Tutorial Showing them?

alt Re: [Menu] Type's

Gaios
Reviewer Off Offline

Zitieren
Spoiler >


not understand.
Screen in cs2d 640x480
center in cs2d 320x240
ok?

alt Re: [Menu] Type's

Jhony
User Off Offline

Zitieren
user Gaios hat geschrieben
Spoiler >


not understand.
Screen in cs2d 640x480
center in cs2d 320x240
ok?


wtf??

What Hell is that?
So I want to Learn Numbers of Positions
Example: Placing Images below (Number of Position? <- Example)
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht