Forum

> > CS2D > Scripts > Capacity error
Forums overviewCS2D overview Scripts overviewLog in to reply

English Capacity error

7 replies
To the start Previous 1 Next To the start

old Capacity error

Noswear222
User Off Offline

Quote
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
Code 
function st1(st)
         local st = {}
          for i = 1, st do
                   st[i]=0
	end
	return st
end

Capacity=st1(32)
Capacity11=st1(32)
Heath=st1(32)
maxheath=150 --set heath player


addhook("spawn" , "LEQ")
function LEQ(id)
Capacity=Heath
parse('hudtxt2 '..id..' 30 "©255128000Capacity: '..Capacity[id]..'" 239 393 ')
Capacity11[id]=0
Heath[id]=0
maxheath[id]=0
end
    
addhook("move" , "LEQ2")
function LEQ2(id)
	msg2(id,"©000255255kill enemy +11 capacity@C")
	parse('hudtxt2 '..id..' 30 "©255128000Capacity: '..Capacity11[id]..'" 239 393 ')

addhook("menu" , "menu_m")
function menu_m(id,title, button)

menu(id,"Menu Heath,Capacity +20|Heath -17,Heath+32|Capacity-9,Transformation|Hth+150 -100Cpc")
	if (title=="Menu Heath") then
	if button==1 then 
menu(id,"Capacity +11|Heath -17,Heath+32|Capacity-9,Transformation|Hth+150 -100Cpc")
elseif button==2 then
menu(id,"Heath+32|Capacity-9,Transformation|Hth+150 -100Cpc")
elseif button==3 then
menu(id,"Transformation|Hth+150 -100Cpc")
end
	end
	end
	if (title=="Capacity...") then
	if button==1 then 
       	parse('hudtxt2 '..id..' 30 "©000255255Capacity: '..Capacity11[id]..'" 239 393 ')
end
	end
	end
edited 1×, last 21.05.11 05:55:25 pm

old Re: Capacity error

Mechanolith
User Off Offline

Quote
Oh, it's me who needs to say sorry, i thought you were one more of those retards who keeps creating stupid threads like: "Hello", or "Help!!1!1!1!!"

Sorry

old Re: Capacity error

Yates
Reviewer Off Offline

Quote
Damn dude, your tabbing sucks.

What's the error in the console?

old Re: Capacity error

J4x
User Off Offline

Quote
One of the problems is that the For limit must be a number and you are using an array as the limit value.
PS: if im wrong just correct me.

old Re: Capacity error

EngiN33R
Moderator Off Offline

Quote
@FN_Linkin Park
You are right.
1
2
3
4
5
6
7
function st1(st)
local st = {}
for i = 1, st do
st[i]=0
     end
     return st
end
Should be
1
2
3
4
5
6
7
function st1(st)
     local stt = {}
     for i = 1, st do
          stt[i]=0
     end
     return stt
end
Because if you name the argument and the table the same it won't work.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview