English Script not working

6 replies
Goto Page
To the start Previous 1 Next To the start
25.06.12 10:57:22 am
Up
deividas270
User
Offline Off
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?
25.06.12 11:28:06 am
Up
shotnine
User
Offline Off
Code:
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
shotgod
25.06.12 11:37:39 am
Up
deividas270
User
Offline Off
oh, but it still dont work it says something about nill value
25.06.12 12:16:48 pm
Up
Jynxxx
User
Offline Off
you spelled 1 word wrong that messed it all up you put

Code:
1
function admmenu(id,title,buton)

it should be
Code:
1
function admmenu(id,title,button)

take a look at the difference
25.06.12 12:20:08 pm
Up
sheeL
User
Offline Off
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 !
25.06.12 12:49:42 pm
Up
deividas270
User
Offline Off
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 .
25.06.12 02:28:42 pm
Up
Jynxxx
User
Offline Off
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.
Code:
1
addhook("spawn","spawn1")

Spoiler >
To the start Previous 1 Next To the start