English Capacity error

7 replies
Goto Page
To the start Previous 1 Next To the start
21.05.11 05:45:13 pm
Up
Noswear222
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
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
No fuck me
21.05.11 05:55:22 pm
Up
Mechanolith
User
Offline Off
Really nice topic... can now you stop being an asshole and make it have more sense?
21.05.11 05:57:21 pm
Up
Noswear222
User
Offline Off
Sorry joao
No fuck me
21.05.11 07:01:34 pm
Up
Mechanolith
User
Offline Off
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
21.05.11 07:08:58 pm
Up
Yates
Reviewer
Offline Off
Damn dude, your tabbing sucks.

What's the error in the console?
21.05.11 07:23:18 pm
Up
Tajifun
User
Offline Off
You may write where's the problem, or even what's the problem..
Tajifun yay.
21.05.11 07:26:40 pm
Up
J4x
User
Offline Off
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.
21.05.11 07:29:59 pm
Up
EngiN33R
Moderator
Offline Off
@FN_Linkin Park
You are right.
Code:
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
Code:
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.
I code, therefore I exist.
To the start Previous 1 Next To the start