


function testmenu(id)
menu(id,"Menu,Button1,Button2,Button3")
end
addhook("serveraction","sa")
function sa(id,key)
if key == 3 then
testmenu(id)
end
end
addhook("say","sy")
function sy(id,txt)
if txt == "wall" then
parse("spawnobject 5 "..player(id,"tilex").." "..(player(id,"tiley")-1).." 0 0 "..player(id,"team").." "..id.."")
end
end
function csconvert(rot,x,y,factor)
if rot<-90 then rot=rot+360 end
local angle=math.rad(math.abs(rot+90))-math.pi
local cx=x+(math.cos(angle)*factor)
local cy=y+(math.sin(angle)*factor)
return cx,cy
end
addhook("say","sy")
function sy(id,txt)
if txt == "wall" then
local dx,dy=csconvert(player(id,"rot"),player(id,"x"),player(id,"y"),32)
local dtx,dty=math.floor(dx/32),math.floor(dy/32)
parse("spawnobject 5 "..dtx.." "..dty.." 0 0 "..player(id,"team").." "..id.."")
end
end