And if i choose 9 class, then choose another class i will be a vampire but with m4a1 or smth else
Forum
Scripts
Lua Scripts/Questions/HelpAnd if i choose 9 class, then choose another class i will be a vampire but with m4a1 or smth else
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
addhook("hit","hitt")
function hitt(vic,id)
	if sample.classes.class[id] == 9 then
		parse("sethealth "..id.." "..(player(id,"health")+1))
	end
end
addhook("kill","kil")
function kil(id)
	if (sample.classes.class[id] == 9) then
		parse("sethealth "..id.." "..(player(id,"health")+1))
	end
end
http://apache.dataloss.nl/~peter/www.lua.org/pil/11.6.html
And try to learn how to use concatenation.
EDIT:
Read this too
http://lua-users.org/wiki/StringsTutorial
edited 1×, last 25.11.09 09:06:06 pm
What im doing wrong?
edited 3×, last 25.11.09 09:33:06 pm
I want that value of Max health cant decrease but can increase
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
addhook("hit","hitt")
function hitt(vic,id)
	if sample.classes.class[id] == 9 then
		local oldhealth = player(id,"health")
		if (player(id;"health")==player(id,maxhealth)) then
			parse("setmaxhealth "..id.." "..(player(id,"health")+2))
		end
	parse("sethealth "..id.." "..(oldhealth+2))
	end
end
Try that.
And you should really consider telling us about debugging errors (console). It does really help us to help you
it doesn't work but it doesn't "throw" any errors
More silly errors :@
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
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
function array(size,value)
local asd = {}
for i=1, size do
asd[i] = value
end
return asd --LOL
end
function getslotweps(id,slot)
local myweapons = playerweapons(id)
local rt = {}
for i,v in ipairs(myweapons) do
if itemtype(v,"slot") == slot then
table.insert(rt,v)
end
end
return rt
end
--Global table to save what weapons did each player have
a_table = array(
32,
{
prim={},
sec={},
melee={}, --We won't use this
nades={} --neither this
}
)
addhook("startround","omg")
function omg()
for i=1,32 do
if(player(i,"exists")) then
if(player(i,"team")>=1) then
a_table[i].prim=getslotweps(i,1)
for a=1,#a_table[i].prim do
parse("strip "..i.." "..a)
end
a_table[i].sec=getslotweps(i,2)
for m=1,#a_table[i].sec do
parse("strip "..i.." "..m)
end
end
end
end
end
Edit: wtf no tabs again?
tabs when you copy and then paste tabs are deleted :S
EDIT:
same problem:
nothing happens,no errors in console
-WiLSoN- has written that should work. but you need to do the menu thing now.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function zombiemenu(id)
	menu(id,"Zombies Menu,Zombie1,Zombie2")-- zombie classes here
end
addhook("team","teamm")
function teamm(id,team)
	if (team == 1) then
		zombiemenu(id) -- opens zombie class menu
	end
end
addhook("serveraction","svac")
function svac(id,ac)
	if (player(id,"team")==1) then
		if (ac == 1) then
			zombiemenu(id) -- opens zombie menu if you press F2
		end
	end
end
heh, now i must ask, where would i put this in my script?
are you creating a new script ?
or just modifying a sample script ??
if you are creating a new one.
put that on (any ? xD) part
if you are modyfing classes sample:
If you're having more problems just tell us
also, thanks for all your help
[06:40:44] Prepare To Fight!
[06:40:45] U.S.G.N.: Sending serverlist DELETE-request... (85.214.102.60:36963)
[06:40:45] U.S.G.N.: Server removed from serverlist
[06:40:45] ----- Disconnected -----
[06:40:45] M-NET: received unexpected msg (39, 93.100.59.206:36963)
[06:40:46] M-NET: received unexpected msg (134, 95.32.54.137:4146)
[06:40:46] M-NET: received unexpected msg (41, 220.255.180.51:36963)
[06:40:46] M-NET: received unexpected msg (116, 220.255.180.51:36963)
[06:40:46] U.S.G.N.: Ping/State 'not playing' (200 ms)
[06:40:46] M-NET: received unexpected msg (93, 90.22.125.191:2362)
[06:40:46] M-NET: received unexpected msg (116, 90.22.125.191:2362)
[06:40:46] M-NET: received unexpected msg (33, 90.151.2.19:36963)
[06:40:46] M-NET: received unexpected msg (116, 90.151.2.19:36963)
[06:40:47] M-NET: received unexpected msg (115, 189.19.112.87:60948)
[06:40:48] M-NET: received unexpected msg (219, 79.240.179.215:1282)
[06:40:48] M-NET: received unexpected msg (116, 79.240.179.215:1282)
[06:40:49] M-NET: received unexpected msg (83, 95.32.54.137:4146)
[06:40:49] M-NET: received unexpected msg (245, 220.255.180.51:36963)
[06:40:49] M-NET: received unexpected msg (116, 220.255.180.51:36963)
[06:40:49] M-NET: received unexpected msg (23, 90.22.125.191:2362)
[06:40:49] M-NET: received unexpected msg (116, 90.22.125.191:2362)
[06:40:49] M-NET: received unexpected msg (9, 59.6.241.102:61550)
[06:40:49] M-NET: received unexpected msg (116, 59.6.241.102:61550)
[06:40:49] M-NET: received unexpected msg (238, 90.151.2.19:36963)
[06:40:49] M-NET: received unexpected msg (116, 90.151.2.19:36963)
[06:40:49] M-NET: received unexpected msg (116, 79.133.136.42:56437)
[06:40:49] M-NET: received unexpected msg (23, 79.133.136.42:56437)
[06:40:51] M-NET: received unexpected msg (157, 79.240.179.215:1282)
[06:40:51] M-NET: received unexpected msg (116, 79.240.179.215:1282)
[06:40:52] M-NET: received unexpected msg (116, 220.255.180.51:36963)
[06:40:52] M-NET: received unexpected msg (174, 220.255.180.51:36963)
[06:40:52] M-NET: received unexpected msg (208, 90.151.2.19:36963)
[06:40:52] M-NET: received unexpected msg (116, 79.133.136.42:56437)
[06:40:52] M-NET: received unexpected msg (216, 79.133.136.42:56437)
[06:40:52] M-NET: received unexpected msg (116, 90.151.2.19:36963)
[06:40:55] M-NET: received unexpected msg (116, 220.255.180.51:36963)
[06:40:55] M-NET: received unexpected msg (155, 79.133.136.42:56437)
[06:40:55] M-NET: received unexpected msg (116, 79.133.136.42:56437)
[06:40:58] M-NET: received unexpected msg (116, 220.255.180.51:36963)
-WiLSoN- has written
Check Bold text
thanks, but what do i change with the bold text? :p lol im such a n00b
Vectar666 has written
I think you must change all sample.classes.team to sample.zombie.team
holy cow! it worked!
thank you SOOOO much! now, how do i make it so when you change class it will change next time you spawn? instead of instantly killing you?also, when you change back to survivor it keeps you with the "zombie" class, but you cant change to normal. how would i change that,so that it makes you just a normal survivor?
edited 2×, last 26.11.09 04:04:12 am
Lua Scripts/Questions/Help


Offline
