English Request Hud script

12 replies
Goto Page
To the start Previous 1 Next To the start
30.08.12 11:02:43 pm
Up
Deevix
User
Offline Off
Hello I would like if possible and I think it can ...
A script as shown
IMG:http://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
30.08.12 11:06:20 pm
Up
Yates
Reviewer
Offline Off
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.
30.08.12 11:20:55 pm
Up
Deevix
User
Offline Off
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
30.08.12 11:56:49 pm
Up
Gaios
Security Supporter
Offline Off
Code:
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.
31.08.12 12:48:49 am
Up
omg
User
Offline Off
no seriously, listen to what yates has to say. its REALLY EASY
will code for food
31.08.12 12:20:15 pm
Up
Deevix
User
Offline Off
sorry not good you can do as super hero? sh_help.txt
31.08.12 12:29:02 pm
Up
Happy eyes
User
Offline Off
user Gaios has written:
Code:
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.
31.08.12 01:48:00 pm
Up
Gaios
Security Supporter
Offline Off
This is it:
Code:
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
31.08.12 01:54:00 pm
Up
Happy eyes
User
Offline Off
user Gaios has written:
This is it:
Code:
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
31.08.12 02:01:26 pm
Up
Gaios
Security Supporter
Offline Off
CORRET CODE:
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
edited 1×, last 31.08.12 02:21:31 pm
31.08.12 05:24:14 pm
Up
Happy eyes
User
Offline Off
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
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
02.09.12 03:40:59 pm
Up
tom282f3
User
Offline Off
1. Create a script reads txt.
2. Type your messages in.
3. Use "for" to make hudtxt from it.
cs2dbbs.gameclub.tw - LEGACY
05.09.12 02:45:56 pm
Up
MikuAuahDark
User
Offline Off
Code:
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
file cs2d LuaJIT for Dedicated Server (13) JIT POWER! | Know your Lua errors! | Part of LÖVE development team since 11.3
To the start Previous 1 Next To the start