like saying !equip 45
1
parse('equip '..id..' '..wepid)
insted of equip 45, i will say equip laser
then it will automatically turn to 45.
how can i do it?
parse('equip '..id..' '..wepid)
--=======================-- --== Gajos PL (108942) ==-- --=======================-- Admins = {108942} --=======================-- c = string.char(169) point = {} point.initArray = function(value) 	local array = {} 	for _ = 1,32 do 		array[_] = value 	end 	return array end point.ToTable = function(t,match) 	local cmd = {}; 	if not match then match = "[^%s]+" end 	for word in string.gmatch(t,match) do 		table.insert(cmd,word) 	end 	return cmd end point.bug = function(id,txt) 	msg2(id,c.."200000000Unknown command: "..c.."000255255"..txt) end point.noadm = function(id) 	msg2(id,c.."200000000You don't have enough level to do this!") end point.noe = function(id) 	msg2(id,c.."200000000This player doesn't exist!") end point.isAdmin = function(id) 	for _, i in pairs(Admins) do 		if player(id,"usgn") == i then 			return true 		end 	end 	return false end point.isItem = function(txt) 	for _ = 1,100 do 		if txt == itemtype(_,"name") then 			point.item = _ 			return true 		end 	end 	return false end addhook("say","point.say") point.say = function(id,txt) 	local p = point.ToTable(txt) 	local cmd = string.lower(p[1]) 	if txt:sub(1,1) == "@" and txt ~= "rank" then 		if cmd == "@setpoints" then 			if point.isAdmin then 				local pl = tonumber(p[2]) 				local points = tonumber(p[3]) 				if pl ~= nil and points ~= nil then 					if player(pl,"exists") then 						killpt[id] = points 					else 						noe(id) 					end 				else 					msg2(id,c.."200000000Correct syntax: @setpoints <id> <points>") 				end 			else 				point.noadm(id) 			end 		elseif cmd == "@givepoints" then 			if point.isAdmin then 				local pl = tonumber(p[2]) 				local points = tonumber(p[3]) 				if pl ~= nil and points ~= nil then 					if player(pl,"exists") then 						killpt[id] = killpt[id] + points 					else 						noe(id) 					end 				else 					msg2(id,c.."200000000Correct syntax: @givepoints <id> <points>") 				end 			else 				point.noadm(id) 			end 		elseif cmd == "@equip" then 			if point.isAdmin then 				local item = p[2] 				if item ~= nil then 					if point.isItem(item) then 						parse("equip "..id.." "..point.item) 					else 						msg2(id,c.."200000000Error: This item does not exist") 					end 				else 					msg2(id,c.."200000000Correct syntax: @equip <itemname>") 				end 			else 				point.noadm(id) 			end 		else 			point.bug(id,txt) 		end 		return 1 	end end
addhook('say', 'AA_say') function splitString(str) 	local c = {} 	for word in string.gmatch(str, '[^%s]+') do 		table.insert(c, word) 	end 	return c end function AA_say(id, txt) 	local value = {} 	local cmd, value[1], value[2] = commandHandler(txt) -- commands 	if cmd == 'equip' then 		parse('equip '..value[2]..' '..value[1]) 	elseif cmd == 'spawn' then 		parse('spawnitem '..value[1]..' '..player(value[2], 'tilex')..' '..player(value[2], 'tiley')) 	end end function commandHandler(txt) 	function checkName(a, end, start) 		if not start then start = 0 end 		for i = start, end do 			if a == itemtype(i, 'name') then 				return true, i; 			end 		end 		return false, 0; 	end 	local a = splitString(txt) 	if a[1] == '!equip' then 		local bool, id = checkName(a[3], 100) 		if bool then 			return 'equip', id, a[2]; 		end 	elseif a[1] == '!spawn' then 		local bool, id = checkName(a[3], 100) 		if bool then 			return 'spawn', id, a[2]; 		end 	end end
--Hook say to sayHook --splitstring: A function that: 	- inputs a string (txt in this case) 	- seperates every part, between spaces ([^%s]+), from it in an array 	- returns the array --AA_say: A function that: 	- is called when someone says something 	- calls commandHandler (read further on command handler) 	- .. 	- if the message started with !equip or !spawn, do that stuff 	- spawn the returned value[1] (weapon id) in hands of or under the feets of value[2] (player id) --commandHandler: A function (extension to AA_say) that: 	- splits the player's message in array a[], seperated into; 		+ a[1] (command, !equip or !spawn) 		+ a[2] (playerid, 1 - 32) 		+ a[3] (weapon name, laser or so) 	- if the command in caps is '!EQUIP' or '!SPAWN', run through that function 	- if the player a[2] isn't dead, look what weapon he has to get with checkName, a function that; 		+ cycles through all weapon id's 		+ looks whether that itemtype exists 		+ looks if the item's name matches a[3], the requested item name 		+ returns true if it does and false if it doesn't 		+ if it's true, it also returns the found weapon type 	- if checkName found a name matching the message (bool == true), it will continue, else it will send an error to the console 	- it then returns the command (equip), the weapon id (id), and the player id (a[2])
local name = "" for i = 2, #t do if i ~= 2 then name = name.." "..t[i] else name = t[i] end end
toTable("!equip rpg launcher")
{"!equip", "rpg", "launcher"}
!equip 1 rpg launcher
local d = a[3] local e = false if a[4] then for i = 4, #a do d = d..' '..a[i] end e = true end