How to remove weapon in slot?Please code.
eg:
1
2
3
4
5
6
2
3
4
5
6
addhook('say','SayHook')
function SayHook(id,txt)
	if txt=="@remove 32" then -- m4a1
		************ CODE ************
	end
end
Scripts
[Request] Remove the weapon
[Request] Remove the weapon
1

How to remove weapon in slot?addhook('say','SayHook')
function SayHook(id,txt)
	if txt=="@remove 32" then -- m4a1
		************ CODE ************
	end
end
addhook('say','SayHook')
function SayHook(id,txt)
if txt=="@remove 32" then -- m4a1
parse("strip "..id.." 32")
	msg2(id,"Your M4 is stripped!")
end
end
addhook('say','a')
function a(id,txt,itemtype)
	if txt=="@remove 32" or "!remove 32" ten -- m4a1
parse("removeitem '..itemtype)
	msg2(id,"Your M4A1 As Ben Removed!")
end
end
RedizGaming: No, Just no. The say hook doesn't have an itemtype parameter.
RedizGaming has writtenaddhook('say','a')
function a(id,txt,itemtype)
	if txt=="@remove 32" or "!remove 32" ten -- m4a1
parse("removeitem '..itemtype)
	msg2(id,"Your M4A1 As Ben Removed!")
end
end

Bowlinghead has writtenaddhook('say','SayHook')
function SayHook(id,txt)
if txt=="@remove 32" then -- m4a1
parse("strip "..id.." 32")
	msg2(id,"Your M4 is stripped!")
end
end
addhook('say','SayHook')
function SayHook(id,txt)
if split(txt, " ")[0]=="@remove" then
if (#split(txt, " ") > 1) then
parse("strip "..id.." "..split(txt, " ")[1])
msg2(id,"Your Weapon is stripped!")
else
msg2(id,"Missing param (Weapon ID)")
end
end
end
ohaz: You forgot the split function there
addhook('say','SayHook')
function SayHook(id,txt)
	if txt:lower():sub(1,7) =="@remove" then
		local wpn = txt:sub(9,10)
		if wpn then
			parse("strip "..id.." "..wpn)
			msg2(id,"Your "..itemtype(wpn,"name").." was stripped!")
			return 1
		else
			msg2(id,"Missing param (Weapon ID)")
		end
	end
end
ohaz: string.sub doesn't force you to use 2 digits long IDs, I have already tested it
omg: It doesn't have to be converted to integer, the parse function reads strings, not numbers, and also when you concatenate strings, the integer (for example 4) will be converted to a string automatically.
1
