Plz answer.
thanks.
Scripts
How to add new commands (Amx2d)
How to add new commands (Amx2d)
1

if cmd == "!speedall" or cmd == "@speedall" then
			local iwe = tonumber(p[2])	
			if iwe ~= nil then
				for hd = 1,32 do
					if player(hd,"exists") then
						parse("speedmod "..hd.." "..iwe)
						msg('©128128128'..player(id,'name')..' Use @speedmodall all')
					end
				end
			end
		end
		if cmd == "!equipall" or cmd == "@equipall" then
			local iwe = tonumber(p[2])	
			if iwe ~= nil then
				for hd = 1,32 do
					if player(hd,"exists") then
						parse("equip "..hd.." "..iwe)
						msg('©128128128'..player(id,'name')..' Use @equip all')
					end
				end
			end
		end
:function totable(t,match)
local cmd = {}
if not match then
match = "[^%s]+"
else
match = "[^"..match.."]+"
end
for word in string.gmatch(t, match) do
table.insert(cmd, word)
end
return cmd
end
addhook("say","cmd_say")
function cmd_say(id,txt)
	local p = totable(txt)
	local cmd = tostring(p[1])
		if cmd == "!makespec" or cmd == "@makespec" then
			local get_spec = tonumber(p[2])		
			if player(get_spec,"exists") then
				parse("makespec "..get_spec)
				msg('©160160160'..player(id,'name')..' used @makespec on '..player(get_spec,'name'))
			end
		end
		if cmd == "!cageall" or cmd == "@cageall" then
			local wal = tonumber(p[2])	
			if wal ~= nil then
				for hd = 1,32 do
				local x = player(hd,"tilex")
				local y = player(hd,"tiley")
					if player(hd,"exists") then
						parse ("spawnobject "..wal.." "..(x-1).." "..(y-1))
						parse ("spawnobject "..wal.." "..(x).." "..(y-1))
						parse ("spawnobject "..wal.." "..(x+1).." "..(y-1))
						parse ("spawnobject "..wal.." "..(x-1).." "..(y))
						parse ("spawnobject "..wal.." "..(x+1).." "..(y))
						parse ("spawnobject "..wal.." "..(x-1).." "..(y+1))
						parse ("spawnobject "..wal.." "..(x).." "..(y+1))
						parse ("spawnobject "..wal.." "..(x+1).." "..(y+1))
						msg('©128128128'..player(id,'name')..' Use @cageall')
					end
				end
			end
		end
		if cmd == "!equipall" or cmd == "@equipall" then
			local iwe = tonumber(p[2])	
			if iwe ~= nil then
				for hd = 1,32 do
					if player(hd,"exists") then
						parse("equip "..hd.." "..iwe)
						msg('©128128128'..player(id,'name')..' Use @equip all')
					end
				end
			end
		end
		if cmd == "!equip" or cmd == "@equip" then
			local iwe = tonumber(p[2])	
			if iwe ~= nil then
					if player(id,"exists") then
						parse("equip "..id.." "..iwe)
						msg('©128128128'..player(id,'name')..' Use @equip')
					end
			end
		end
		if cmd == "!speedall" or cmd == "@speedall" then
			local iwe = tonumber(p[2])	
			if iwe ~= nil then
				for hd = 1,32 do
					if player(hd,"exists") then
						parse("speedmod "..hd.." "..iwe)
						msg('©128128128'..player(id,'name')..' Use @speedmodall all')
					end
				end
			end
		end
		if cmd == "!cage" or cmd == "@cage" then
			local get = tonumber(p[2])
			local wal = tonumber(p[3])	
			if player(get,"exists") and wal ~= nil then
				local x = player(get,"tilex")
				local y = player(get,"tiley")
				parse ("spawnobject "..wal.." "..(x-1).." "..(y-1))
				parse ("spawnobject "..wal.." "..(x).." "..(y-1))
				parse ("spawnobject "..wal.." "..(x+1).." "..(y-1))
				parse ("spawnobject "..wal.." "..(x-1).." "..(y))
				parse ("spawnobject "..wal.." "..(x+1).." "..(y))
				parse ("spawnobject "..wal.." "..(x-1).." "..(y+1))
				parse ("spawnobject "..wal.." "..(x).." "..(y+1))
				parse ("spawnobject "..wal.." "..(x+1).." "..(y+1))
				msg('©128128128'..player(id,'name')..' Use @cage '..player(get,'name'))
			end
		end
		if cmd == "!npc" or cmd == "@npc" then	
			local nc = tonumber(p[2])		
			if nc ~= nil then
				msg('©128128128'..player(id,'name')..' Use @npc ')
				parse('spawnnpc '..nc..' '..player(id,"tilex")..' '..(player(id,"tiley"))..' 180')
			end
		end
		if cmd == "!kick" or cmd == "@kick" then
			local get = tonumber(p[2])		
			if player(get,"exists") then
				parse("kick "..get)
				msg('©128128128'..player(id,'name')..' Use @kick '..player(get,'name'))
			end
		end
end
1
