Forum

> > CS2D > Scripts > Script not working
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script not working

6 replies
To the start Previous 1 Next To the start

old Script not working

deividas270
User Off Offline

Quote
Hello, sorry for so many threads recently. I have server and i want to make admin script, so here is the start of my script(didnt make more).

     
addhook("spawn","spawn1")
addhook("menu","admmenu")
addhook("serveraction","SAction1")
function SAction1(id,act)
     if(player(id,"usgn")==22269) then
          if act==1 then
               menu(id,"Admin Menu, Server Settings, Fun menu, Punish menu, load scripts")
          end
     end     
end
     
function admmenu(id,title,buton)
     if title=="Admin menu" then
          if button==1 then
          menu(id,"Server Settings,bots,Fog Of War,Infammo,AntiSpeeder")
          end
     end
     if title=="Server" then
          if button==1 then
          menu(id,"infAmmo, on, off")
          end
     end
end
Yes, i know it doesnt do anything... OK, so main problem is that when i press f2 and then press on server settings, nothing is happening. Menu just closes. How could i fix this?

old Re: Script not working

shotnine
User Off Offline

Quote
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
addhook("spawn","spawn1")
addhook("menu","admmenu")
addhook("serveraction","SAction1")
function SAction1(id,act)
	if(player(id,"usgn")==22269) then
		if act==1 then
			menu(id,"Admin Menu, Server Settings, Fun menu, Punish menu, load scripts")
		end
	end     
end
     
function admmenu(id,title,button)
	if title=="Admin menu" then
		if button==1 then
			menu(id,"Server Settings,bots,Fog Of War,Infammo,AntiSpeeder")
		end
	end
	if title=="Server Setting " then --- ERROR HERE
		if button==3 then
			menu(id,"infAmmo, on, off")
		end
	end
	if title=="infAmmo" then
		infammo=button-1
	end
end
edited 1×, last 25.06.12 03:30:56 pm

old Re: Script not working

Jynxxx
User Off Offline

Quote
you spelled 1 word wrong that messed it all up you put

1
function admmenu(id,title,buton)
it should be
1
function admmenu(id,title,button)
take a look at the difference

old Re: Script not working

sheeL
User Off Offline

Quote
user deividas270 has written
Hello, sorry for so many threads recently. I have server and i want to make admin script, so here is the start of my script(didnt make more).

     
addhook("spawn","spawn1")
addhook("menu","admmenu")
addhook("serveraction","SAction1")
function SAction1(id,act)
     if(player(id,"usgn")==22269) then
          if act==1 then
               menu(id,"Admin Menu, Server Settings, Fun menu, Punish menu, load scripts")
          end
     end     
end
     
function admmenu(id,title,buton)
     if title=="Admin menu" then
          if button==1 then
          menu(id,"Server Settings,bots,Fog Of War,Infammo,AntiSpeeder")
          end
     end
     if title=="Server" then
          if button==1 then
          menu(id,"infAmmo, on, off")
          end
     end
end
Yes, i know it doesnt do anything... OK, so main problem is that when i press f2 and then press on server settings, nothing is happening. Menu just closes. How could i fix this?


@user deividas270:
I see you edited my menu, and their functions in script
Avoid editing Things in my script, not to give error
srorry english !

old Re: Script not working

deividas270
User Off Offline

Quote
no i didnt edit anything . Made my self, anyway i used some names from admin script v3.0 beta, but that isnt bad, im sure :/. Thanks ,Jet, but it still doesnt work .

old Re: Script not working

Jynxxx
User Off Offline

Quote
This is my way it's not the best but i tried. Also the nil value was because the hook spawn didn't have a function yet.
1
addhook("spawn","spawn1")
Spoiler >
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview