I know how to make invisible menu
example: menu(id,"Select class@i,Soldier")
but how do i make buttons?
menu(id,"Select class@i,Soldier")
men = 2 addhook ("parse","menu") function menu(cmd) if cmd=="otm" and men==2 then men = 1 parse ("sv_sound2 1 weapons/click.wav") parse ("sv_fow 1") parse ('hudtxt2 1 1 "©000255000Fow On" 320 240 0') parse ('hudtxt2 1 2 "©255000000Fow Off" 320 250 0') elseif cmd=="otm" and men==1 then men = 2 parse ("sv_sound2 1 weapons/click.wav") parse ("sv_fow 0") parse ('hudtxt2 1 1 "©255000000Fow On" 320 240 0') parse ('hudtxt2 1 2 "©000255000Fow Off" 320 250 0') end end addhook ("spawn","initial") function initial(id) if id==1 then men = 2 parse ('hudtxt2 1 1 "©255000000Fow On" 320 240 0') parse ('hudtxt2 1 2 "©255000000Fow Off" 320 250 0') end end addhook ("spawn","themenu") function themenu(p) parse ("bind mouse3 otm") end
men = 2 addhook ("serveraction","menu") function menu(id,action) if action==1 and men==2 then men = 1 parse ("sv_sound2 1 weapons/click.wav") parse ("sv_fow 1") parse ('hudtxt2 1 1 "©000255000Fow On" 320 240 0') parse ('hudtxt2 1 2 "©255000000Fow Off" 320 250 0') elseif action==2 then parse ('hudtxt2 1 1 "" 320 240 0') parse ('hudtxt2 1 2 "" 320 250 0') else men = 2 parse ("sv_sound2 1 weapons/click.wav") parse ("sv_fow 0") parse ('hudtxt2 1 1 "©255000000Fow On" 320 240 0') parse ('hudtxt2 1 2 "©000255000Fow Off" 320 250 0') end end
men = 2 addhook ("serveraction","menu") function menu(id,action) if action==1 and men==2 then men = 1 parse ("sv_sound2 1 weapons/click.wav") parse ("sv_fow 1") parse ('hudtxt2 1 1 "©000255000Soldier" 320 240 0') parse ('hudtxt2 1 2 "©255000000Awper" 320 250 0') elseif action==2 then parse ('hudtxt2 1 1 "" 320 240 0') parse ('hudtxt2 1 2 "" 320 250 0') else men = 2 parse ("sv_sound2 1 weapons/click.wav") parse ("sv_fow 0") parse ('hudtxt2 1 1 "©255000000Soldier" 320 240 0') parse ('hudtxt2 1 2 "©000255000Awper" 320 250 0') end end addhook("spawn","chooseclass") function chooseclass(id) if (men==1) then return "40,80"; elseif (men==2) then return "35"; end end