Forum

> > CS2D > Scripts > Request Hud script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Request Hud script

12 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Request Hud script

Deevix
User Off Offline

Zitieren
Hello I would like if possible and I think it can ...
A script as shown
IMG:https://i38.servimg.com/u/f38/17/48/67/01/fh9rgs10.png

The same goes if you can be on F4 to open and close when you press F4

Thanks

alt Re: Request Hud script

Yates
Reviewer Off Offline

Zitieren
1. Download Super Hero script.
2. Find this function.
3. Copy the shit out of it.
4. ???
5. Profit.

Yes, people. It is THAT fucking simple. Stop asking people to do stuff for you when you haven't even tried yourself.

Thanks.

alt Re: Request Hud script

Deevix
User Off Offline

Zitieren
What are you listening to asshole I asked that because I create a own script and not able to do that HUD thousand of those you require help.
so who can help me owe him who does not shut up

alt Re: Request Hud script

Gaios
Reviewer Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
x=20 -- change
y=20 --

gajos=0
addhook("serveraction","gajospl_credits_serveraction")
function gajospl_credits_serveraction(id,key)
	if key==3 then
		if gajos==0 then
			parse("hudtxt2 "..id.." 20 "created by:" "..x.." "..y)
			parse("hudtxt2 "..id.." 21 "gajospl" "..x.." "..y+10.."")
-- next +20
		end
		if gajos==1 then
			parse("hudtxt2 "..id.." 20 " "")
			parse("hudtxt2 "..id.." 21 " "")
		end
	end
end

If it does not work, tell me.

alt Re: Request Hud script

Happy eyes
User Off Offline

Zitieren
user Gaios hat geschrieben
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
x=20 -- change
y=20 --

gajos=0
addhook("serveraction","gajospl_credits_serveraction")
function gajospl_credits_serveraction(id,key)
	if key==3 then
		if gajos==0 then
			parse("hudtxt2 "..id.." 20 "created by:" "..x.." "..y)
			parse("hudtxt2 "..id.." 21 "gajospl" "..x.." "..y+10.."")
-- next +20
		end
		if gajos==1 then
			parse("hudtxt2 "..id.." 20 " "")
			parse("hudtxt2 "..id.." 21 " "")
		end
	end
end
If it does not work, tell me.


This wont work becouse:
variable gajos wont change when you use serveraction
if you make variable gajos change, then it immediately will br changed to the same state it was, becouse the second if does that. You should use elseif.

alt Re: Request Hud script

Gaios
Reviewer Off Offline

Zitieren
This is it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
gajos=0
addhook("serveraction","gajospl_credits_serveraction")
function gajospl_credits_serveraction(id,key)
     if key==3 then
          if gajos==0 then
               parse('hudtxt2 '..id..' 20 "created by:" 20 20')
               parse('hudtxt2 '..id..' 21 "GajosPL" 20 30')
			   gajos=1
          elseif gajos==1 then
               parse('hudtxt2 '..id..' 20 " "')
               parse('hudtxt2 '..id..' 21 " "')
			   gajos=0
          end
     end
end

alt Re: Request Hud script

Happy eyes
User Off Offline

Zitieren
user Gaios hat geschrieben
This is it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
gajos=0
addhook("serveraction","gajospl_credits_serveraction")
function gajospl_credits_serveraction(id,key)
     if key==3 then
          if gajos==0 then
               parse('hudtxt2 '..id..' 20 "created by:" 20 20')
               parse('hudtxt2 '..id..' 21 "GajosPL" 20 30')
			   gajos=1
          elseif gajos==1 then
               parse('hudtxt2 '..id..' 20 " "')
               parse('hudtxt2 '..id..' 21 " "')
			   gajos=0
          end
     end
end


You also should make variable gajos different for every player (use array), so if hud is on for player id 3, it could be off for player id 5

alt Re: Request Hud script

Gaios
Reviewer Off Offline

Zitieren
CORRET CODE:
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
function Array(s,v)
	local a = {}
	for i = 1,s do
		a[i] = v
	end
	return a
end
gajos=Array(32,0)
addhook("spawn","gajospl_credits_spawn")
function gajospl_credits_spawn(id)
gajos[id]=1
	if gajos[id]==1 then
		parse('hudtxt2 '..id..' 20 "created by:" 20 20')
		parse('hudtxt2 '..id..' 21 "GajosPL" 20 30')
	end
end
addhook("serveraction","gajospl_credits_serveraction")
function gajospl_credits_serveraction(id,key)
	if key==3 then
		if gajos[id]==0 then
			parse('hudtxt2 '..id..' 20 "created by:" 20 20')
			parse('hudtxt2 '..id..' 21 "GajosPL" 20 30')
			gajos[id]=1
		elseif gajos[id]==1 then
			parse('hudtxt2 '..id..' 20 " "')
			parse('hudtxt2 '..id..' 21 " "')
			gajos[id]=0
		end
	end
end
1× editiert, zuletzt 31.08.12 14:21:31

alt Re: Request Hud script

Happy eyes
User 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
44
45
46
47
48
49
50
hud = {
	"SuperHero Help",
	"skip",
	"Author: Blazzingxx",
	"Version: 1.0b",
	"Released: 2010/03/12",
	"skip",
	"===================",
	"skip",
	"Client Commands:",
	"!help",
	"!commands",
	"!myheroes"
}

function showhud(id)
	local skipped = 0
	for n,w in pairs (hud) do
		local x = 10
		local y = 100
		if w ~= "skip" then
			parse('hudtxt2 '..id..' '..n-skipped..' "'..w..'" 10 '.. 100+(15*(n)))
		else
			skipped=skipped+1
		end
	end
end

huds={}
for a=1,32 do
	huds[a]=true
end

addhook('join','join')
function join(id)
	huds[id]=true
	showhud(id)
end

addhook('serveraction','serveraction')
function serveraction(id,action)
	if action == 3 then
		if huds[id] then
			huds[id]=false
		else
			huds[id]=true
			showhud(id)
		end
	end
end

Change table [hud] to fit your needs

alt Re: Request Hud script

MikuAuahDark
User 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
hudfile = "sys/lua/hudf.txt" -- must exists just create a txt file with that name and fill it with a text that will to be showed or just change the directory and do what i said before
stats, length = {},{}
spaces = 10
for id = 1,32 do stats[id]=false length[id]=0 end
addhook("serveraction","sact")
function sact(id,act)
	if act==3 then
		if stats[id]==true then
			for line = 1,length[id] do
				parse("hudtxt2 "..id.." txt"..line.." \" \" 0 0")
			end
			stats[id]=false
		elseifif stats[id]==false then
			test = 0
			for line in io.lines(hudfile) do
				test=test+1
				parse("hudtx2 "..id.." txt"..test.." \""..line.."\" 3 "..(110+(spaces*test)))
			end
			length[id]=test
			stats[id]=true
		end
	end
end
untested. sorry if there is a any error, this is because im very busy
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht