2 Days ago i detected, i cant use math.**
I need some math examples and i dont want LUA.ORG Exam because Lua.org examples not understandable for me
just some examp
THX,
edited 1×, last 07.11.11 05:31:58 pm
print(math.random(1,3)) -- randomly selected number between 1 and 3!
addhook ("say","loldatthread"); --hooking the say event to a function function loldatthread(id,txt) --declairing a function + (parameters) btw. starting a function if (txt=="lol") then -- checks if the given text ist equal to "lol". print(math.random(1,5)) --generates a random number between 1 to 5 and shows it in the console end --end of the if block end --end of function
math.cos(0,5) > 1
math.cos(ANGLE*DEG_TO_RAD)
function drawLaserPointer(p) 	--if ( last_rot[p-1] ~= player(p,"rot") ) then 		local rot,x,y = (player(p,"rot")-90)*math.pi/180,player(p,"x"),player(p,"y"); 		last_rot[p-1] = player(p, "rot"); 		x = x + 16*math.cos(rot); 		y = y + 16*math.sin(rot); 		local scale = 32; 		if ( img_data[p-1] == -1 ) then 			img_data[p-1] = image("gfx/plot_.bmp",x,y,1,0); 		end 		while ( (not tile(ConvertCoord(x),ConvertCoord(y),"wall")) and (not tile(x, y, "playeron", p)) ) do 			x = x+math.cos(rot); 			y = y+math.sin(rot); 			scale = scale + 1; 			--imagepos(img_data[p-1], player(p,"x"), player(p,"y"), rot*180/math.pi); 		end 		if ( end_pnt[p-1] == -1 ) then 			end_pnt[p-1] = image("gfx/flare_fb.bmp", x, y, 1, 0) 		end 		imagepos(end_pnt[p-1], x, y, math.random(0, 360)) 		imagescale(end_pnt[p-1], 0.1, 0.1) 		imagecolor(end_pnt[p-1], COLOR__[0], COLOR__[1], COLOR__[2]) 		imagescale(img_data[p-1], findchange(32, scale),1); 		imagepos(img_data[p-1], player(p,"x")+(scale/2)*math.cos(rot), player(p,"y")+(scale/2)*math.sin(rot), rot*180/math.pi); 		imagecolor(img_data[p-1], COLOR__[0], COLOR__[1], COLOR__[2]); 		imagealpha(img_data[p-1], 0.65); 	--end end