while players shooting primary or secondary weapon, weapons will be jammed in rare case.
when weapons jammed, player's ammo will saved at temporary variables, remove player's weapon's ammo values. and then when player unjams it, temporary variable will replace empty ammo.
the error appears at line 50
1
LUA ERROR: sys/lua/jam.lua:50: attempt to concatenate field '?' (a boolean value)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
function array(g,r)
	local a={}
	for i=1,g do
		a[i]=r
	end
	return a
end
jammy={}
jammy.user=array(32,0)
jammy.tempam=array(32,0)
jammy.tempamin=array(32,0)
addhook("attack","jammy.atk")
function jammy.atk(id)
wep = player(id,"weapontype")
	if (wep>=1 and wep<=49) then
	jamrandom=math.random(1,5)
		if (jamrandom==1) then
		parse("sv_sound2 "..id.." \"env/click2.wav\"")
		parse("effect \"smoke\" "..player(id,"x").." "..player(id,"y").." 20 0")
		parse("effect \"fire\" "..player(id,"x").." "..player(id,"y").." 1 0")
		parse("explosion "..player(id,"x").." "..player(id,"y").." 15 3 0")
		parse("setammo "..id.." "..wep.." 0 0")
		timer(500,"parse","strip "..id.." "..wep.."")
		elseif (jamrandom==2) then
		jammy.user[id]=1
		jammy.tempam[id]=item(id,"ammo") -- save player's weapon's ammo value at "temporary variable"
		jammy.tempamin[id]=item(id,"ammoin")
		parse("setammo "..id.." "..wep.." 0 0")
		hudm(id)
		end
	end
end
function hudm(id)
parse("hudtxt2 "..id.." 5 \"\169230230230Press [E] to Unjam\" -120 84")
parse("hudtxtalphafade "..id.." 5 1 0.0")
parse("hudtxtmove "..id.." 5 500 30 84")
parse("hudtxtalphafade "..id.." 5 1000 1.0")
end
addhook("use","jammy.use")
function jammy.use(id,e)
	if e==0 then
		if jammy.user[id]==1 then
		parse("sv_sound2 "..id.." \"env/click2.wav\"")
		wep = player(id,"weapontype")
		 parse("setammo "..id.." "..wep.." "..jammy.tempamin[id].." "..jammy.tempam[id]) -- Error appears at this line
		parse("sv_sound2 "..id.." \"Oops321/Weapon/unjammed.ogg\"")
		jammy.user[id]=0
		parse("hudtxtalphafade "..id.." 5 3000 0.0")
		end
	end
end
	
function jamre(id)
wep = player(id,"weapontype")
parse("setammo "..id.." "..wep.." "..jammy.tempamin[id].." "..jammy.tempam[id])
parse("sv_sound2 "..id.." \"Oops321/Weapon/unjammed.ogg\"")
jammy.user[id]=0
parse("hudtxtalphafade "..id.." 5 3000 0.0")
end
thanks for read , sorry for bad english.
attempt to concatenate field '?'
1 
Offline
_oops