Forum

> > CS2D > Scripts > lua admin
Forums overviewCS2D overview Scripts overviewLog in to reply

English lua admin

2 replies
To the start Previous 1 Next To the start

old lua admin

Spook MQ Hacker
BANNED Off Offline

Quote
guys something wrong with my lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
addhook("menu","admmenu")
function admmenu(id,title,buton)
thenames(i)
if title=="Admin Menu" then
if buton==1 then
menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
end
end
if title=="Spawn Creature" then
if buton==1 then
parse('spawnnpc 1 '..(cx[id]/32)..' '..(cy[id]/32))
menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
elseif buton==2 then
parse('spawnnpc 2 '..(cx[id]/32)..' '..(cy[id]/32))
menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
elseif buton==3 then
parse('spawnnpc 3 '..(cx[id]/32)..' '..(cy[id]/32))
menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
elseif buton==4 then
parse('spawnnpc 4 '..(cx[id]/32)..' '..(cy[id]/32))
menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
elseif buton==5 then
parse('spawnnpc 5 '..(cx[id]/32)..' '..(cy[id]/32))
menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
elseif buton==6 then
menu(id,"Admin Menu,Server Settings,Spawn Creature,Spawn Object,Spawn Item,V.I.P,Punish,Give Items,Restart,More -->")
end
end

help?...

old Re: lua admin

Apache uwu
User Off Offline

Quote
You forgot an end at the end. --''

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
addhook("menu","admmenu")
function admmenu(id,title,buton)
	thenames(i)
		if title=="Admin Menu" then
			if buton==1 then
				menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
			end
		end
		if title=="Spawn Creature" then
			if buton==1 then
				parse('spawnnpc 1 '..(cx[id]/32)..' '..(cy[id]/32))
menu(id,"Spawn 				Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
			elseif buton==2 then
				parse('spawnnpc 2 '..(cx[id]/32)..' '..(cy[id]/32))
				menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
			elseif buton==3 then
				parse('spawnnpc 3 '..(cx[id]/32)..' '..(cy[id]/32))
				menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
			elseif buton==4 then
				parse('spawnnpc 4 '..(cx[id]/32)..' '..(cy[id]/32))
				menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
			elseif buton==5 then
				parse('spawnnpc 5 '..(cx[id]/32)..' '..(cy[id]/32))
				menu(id,"Spawn Creature,Zombie,HeadCrab,Snark,Vortigaunt,Soldier,Back")
			elseif buton==6 then
				menu(id,"Admin Menu,Server Settings,Spawn Creature,Spawn Object,Spawn Item,V.I.P,Punish,Give Items,Restart,More -->")
			end
	end
--missing end
end

Use tabs and you would have seen it quick.

old Re: lua admin

Spook MQ Hacker
BANNED Off Offline

Quote
if i get the

1
2
elseif buton==6 then
                    menu(id,"Admin Menu,Server Settings,Spawn Creature,Spawn Object,Spawn Item,V.I.P,Punish,Give Items,Restart,More -->")

and there is an error

LUA ERROR:sys/lua/CityLife.lua:34: C stack overflow
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview