Quote
EDIT: OMG, *facepalm* I just realised that this is the Lua help thread, my deepest apologies!
@DannyDeth
This happens to everyone once in a while, don't worry.
Scripts
Lua Scripts/Questions/Helpfunction checkweapon(id,weapon) 	local weapons = playerweapons(id) 	for i = 1, #weapons do 		if weapons[i] == weapon then 			return true 		end 	end 	return false end
checkweapon(<id>,74)
local loaded_images = {};
function load_image(path, mode, pl)
	mode = mode or 0;
	pl = pl or 0;
	local f = io.open(path);
	if ( f == nil ) then
		return error("can not find "..path);
	end
	f:close();
	
	table.insert(loaded_images, {[0]=path, id = image(path,0,0,mode,pl)});
	return loaded_images[#loaded_images]["id"];
end
loaded_images[1][0];
freeimage(loaded_images[1]["id"]);
local loaded_images = {};
function load_image(path, mode, pl)
	mode = mode or 0;
	pl = pl or 0;
	local f = io.open(path);
	if ( f == nil ) then
		return error("can not find "..path);
	end
	f:close();
	
	table.insert(loaded_images, {[0]=path, id = image(path,0,0,mode,pl)});
	return loaded_images[#loaded_images]["id"];
end
loaded_images[1][0];
freeimage(loaded_images[1]["id"]);
load_image("./graphics/weapons/bomb.bmp");
-- Some data on that image is stored in loaded_images
imagepos(loaded_images[#loaded_images].id, 50, 75, 0);
load_image("splash.png") -- it is at loaded_images[0]
load_image("player.bmp")
--[[--
	Now the image player.bmp is at 0
	and splash.png is at 1
--]]--
function findImageIDWithPath (path)
	local ret = {};
	for k, v in pairs(loaded_images) do
		if ( loaded_images[k][0] == path ) then
			table.insert(ret, 0, k);
		end
	end
	return ret;
end
addhook("serveraction","za_action")
function za_action(id,action)
	if (action == 1) then
		if player(id,"team") == 2 then
			menu(id,"-SCORE POINTS-BUY MENU-,"..item[1].."|PRICE:".itemprice[1]..","..item[2].."|PRICE:".itemprice[2]..","..item[3].."|PRICE:".itemprice[3]..","..item[4].."|PRICE:".itemprice[4]..","..item[5].."|PRICE:".itemprice[5]..","..item[6].."|PRICE:".itemprice[6]..","..item[7].."|PRICE:".itemprice[7]..","..item[8].."|PRICE:".itemprice[8]..","..item[9].."|PRICE:".itemprice[9].."")
		end
	end
end
addhook("menu","za_menu")
function za_menu(id,title,key)
	if (title == "-SCORE POINTS-BUY MENU-") then
if (key == 1) then
if player(id,"score") >= itemprice[1] then
msg2(id,"©000200000BOUGHT:"..item[1].." FOR:"..itemprice[1].."|SCORE POINTS")
parse("setmaxhealth "..id.." 250")
parse("setarmor "..id.." 200")
parse("setscore "..id.." "..player(id,"score")-itemprice[1].."")
if (key == 2) then
if player(id,"score") >= itemprice[2] then
msg2(id,"©000200000BOUGHT:"..item[2].." FOR:"..itemprice[2].."|SCORE POINTS")
parse("speedmod "..id.." 10")
parse("setscore "..id.." "..player(id,"score")-itemprice[2].."")
if (key == 3) then
if player(id,"score") >= itemprice[3] then
msg2(id,"©000200000BOUGHT:"..item[3].." FOR:"..itemprice[3].."|SCORE POINTS")
noreload[id] = 1
parse("setscore "..id.." "..player(id,"score")-itemprice[3].."")
end
end
end
end
end
end
end
end

addhook("movetile","mypos")
function mypos(id,x,y)
parse('hudtxt2 ..id.. 9 "©255255255Your Tile X,Y '..x..' and '..y..'" 13 350 0')
end
addhook("move","mypos2")
function mypos2(id,x,y,walk)
parse('hudtxt2 ..id.. 10 "©255255255Your X,Y '..x..' and '..y..'" 13 380 0')
end
parse("hudtxt2 "..align.." "..i.." "'..text..'" "..x.." "..y)
parse("hudtxt2 "..align.." "..i.." "'..text..'" "..x.." "..y)
parse('hudtxt '..id..' "'..text..'" '..x..' '..y)
parse('hudtxt2 '..id..' '..idd..' "'..text..'" '..x..' '..y..' '..align)
if (player(id,"name") == "newbie") then
if player(id,"name") == "newbie" then
addhook("say","example")
function example(id,message)
addhook("say","example")
function example(p,t)