Forum

> > CS2D > Scripts > What my error?
Forums overviewCS2D overview Scripts overviewLog in to reply

English What my error?

2 replies
To the start Previous 1 Next To the start

old What my error?

GooDCaT
User Off Offline

Quote
Guys, doing a script to color selection, the menu works but the color ta ta not going

Please only make one? if they can add another question on the menu as "None"
to get the color right?

Thank you Guys, I embrace

sorry for my english

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
addhook("serveraction","lol")
function lol(id,a)
if a == 1 then --F2
if player(id,"usgn")== xxxxx
     menu(id,"Settings,Red Color")
     end
     end
end

addhook("menu","lold")
function lold(id,a,b)
if a == "Settings" then
     if b == 1 then
          function totable(t,match)
          local cmd = {}
          if not match then match = "[^%s]+" end
          for word in string.gmatch(t, match) do
          table.insert(cmd, word)
          end
          return cmd
          end
          if not string.match(txt,(string.char(33))) then
          msg("©255000000"..player(id,"name").." [Admin]: "..txt)
          return 1
          end   
     end
end

old Re: What my error?

Anti-Grav
User Off Offline

Quote
1
if player(id,"usgn")== xxxxx

put your usgn here

Also get the function lold out of the menu function. Put it somewhere under the code. Then use lold() to call it up.

old Re: What my error?

EP
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
color={}
addhook("join","lolz")
function lolz(id)
color[id]=0
end

addhook("serveraction","lol")
function lol(id,a)
if a == 1 then --F2
if player(id,"usgn")== xxxxx then
menu(id,"Settings,Red Color,Pink color,Blue Color")
end
end
end

addhook("menu","lold")
function lold(id,a,b)
if a == "Settings" then
if b == 1 then
color[id]=1
elseif b ==2 then
color[id]=2
elseif b==3 then
color[id]=4
end
end
end

addhook("say","lola")
function lola(id,txt)
if txt ~= "rank" then
if color[id]==1 then
msg("©255000000"..player(id,"name").." [Admin]: "..txt)
return 1
     elseif color[id]==2 then
msg("©255000255"..player(id,"name").." [Admin]: "..txt)
return 1
     elseif color[id]==3 then
msg("©000000255"..player(id,"name").." [Admin]: "..txt)
return 1
end
end
end
edited 2×, last 04.01.12 08:09:02 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview