English Lua error !!

2 replies
Goto Page
To the start Previous 1 Next To the start
05.10.12 10:36:35 pm
Up
Jhony
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
addhook("second","ekip")
function ekip(id)
if player(id,"team") == 1 then
for l = 1,49 do
parse("strip "..l)
end
for v = 52,59 do
parse("strip "..v)
end
for y = 61,68 do
parse("strip "..y)
end
for x = 74,81 do
for i = 1,32 do
parse("strip "..x)
parse("strip "..i.." 84")
parse("strip "..i.." 86")
parse("strip "..i.." 87")
parse("strip "..i.." 89")
parse("strip "..i.." 90")
parse("strip "..i.." 91")
parse("strip "..i.." 92")
return l,v,y,x,i,1
end
end
if player(id,"team") == 2 then
parse("strip "..i.." 85")
parse("strip "..i.." 83")
parse("strip "..i.." 69")
parse("strip "..i.." 60")
parse("strip "..i.." 72")
return i,1
end
end
end


fix please

LUA ERROR: sys/lua/yyy.lua:1528: bad argument #1 to 'player' (number expected, got nil)
05.10.12 10:39:18 pm
Up
Yates
Reviewer
Offline Off
The second hook does not have an id parameter.
Code:
1
if player(id,"team") == 1 then

Will not work.

And tab your code for fuck sake.
06.10.12 08:24:06 pm
Up
Powermonger
User
Offline Off
So if I understood correctly, you want players only use weapons 50, 51, 60, 69, 70, 71, 72 and 73 right?
And if player is using something else, it will be stripped.

If thats true, you should try select hook:
Code:
1
2
3
4
5
6
7
addhook("select","ekip")
function ekip(id)
local p = player(id,"weapontype")
     if p ~= 50 or p ~= 51 or p ~= 60 or p ~= 69 or p ~= 70 or p ~= 71 or p ~= 72 or p ~= 73 then
          parse("strip "..id.." "..p)
     end
end

Works?
To the start Previous 1 Next To the start