English Colour Remove (admin)

27 replies
Goto Page
To the start Previous 1 2 Next To the start
28.04.12 09:53:15 am
Up
Misho
User
Offline Off
Hey guys
I need some help with one script.
Code:
1
2
3
4
5
6
7
8
9
10
11
Admin = {xxxxx}

addhook("say","adminsay")
function adminsay(id,txt)
for _, usgn in ipairs(Admin) do
if player(id,'usgn') == usgn then
msg("©255255255"..player(id,"name").." [Admin] : "..txt)
return 1
end
end
end


So i need one command:
!q and this command will remove the colour of the admin.
I hope you guys can help me.
edited 1×, last 28.04.12 12:32:32 pm
28.04.12 03:00:35 pm
Up
Jynxxx
User
Offline Off
well here you go

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
27
28
29
30
31
function Array(p,q)
     local array = {}
     for o = 1, p do
          array[o] = q or false
     end
     return array
end

admincolor = 1

Admin = {18627}

addhook("say","adminsay")
function adminsay(id,txt)
     for _, usgn in ipairs(Admin) do
          if player(id,"usgn") == usgn then
               if txt=="!q" then
                    admincolor = 0
                    msg2(id,"adminchat removed")
                    return 1
               elseif txt=="!a" then
                    admincolor = 1
                    msg2(id,"adminchat activated")
                    return 1
               elseif admincolor == 1 then
                    msg("©255255255"..player(id,"name").." [Admin] : "..txt)
                    return 1
               end
          end
     end
end
28.04.12 03:22:54 pm
Up
krabob
User
Offline Off
@user Jynxxx: Your code is wrong and stupid.
People help the people
28.04.12 03:33:23 pm
Up
Jynxxx
User
Offline Off
please dont insult my code there is nothing wrong with it.
28.04.12 07:42:58 pm
Up
BlueGums
BANNED
Offline Off
user Jynxxx has written:
please dont insult my code there is nothing wrong with it.

You code is wong and is stupd!.t
28.04.12 07:45:29 pm
Up
Jynxxx
User
Offline Off
why are you both flaming me, that is what he wants i think
28.04.12 07:49:58 pm
Up
BlueGums
BANNED
Offline Off
user Jynxxx has written:
why are you both flaming me, that is what he wants i think

I was joking.
28.04.12 07:51:27 pm
Up
Mechanolith
User
Offline Off
user Jynxxx has written:
please dont insult my code

The code must be very upset right now.
28.04.12 07:54:14 pm
Up
sheeL
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
27
28
29
30
31
32
33
34
35
36
Admin = {45813,xxxxx}

colors = 1

addhook("say","says")
function says(id,t)
for _, usgn in ipairs(Admin) do
if player(id,'usgn') == usgn then
if colors == 1 then
msg("©255255255"..player(id,"name").." [Admin] : "..t)
return 1
end
end
end
end

addhook("say","sayss")
function sayss(id,t)
if colors == 0 then
return false
end
end

addhook("say","ed")
function ed(id,txt)
for _, usgn in ipairs(Admin) do
if player(id,'usgn') == usgn then
if txt == "!enable" then
colors = 1
elseif txt == "!disable" then
colors = 0
end
return 1
end
end
end


fixed
fine works
edited 1×, last 28.04.12 08:04:36 pm
Visit WorldQuality2D website: http://wq2d.com.br /// Upload your map at http://uploadwq2d.tk
28.04.12 08:09:30 pm
Up
Jynxxx
User
Offline Off
what was the problem and why do you have 3 different say hooks?
28.04.12 08:13:54 pm
Up
sheeL
User
Offline Off
user Jynxxx has written:
what was the problem and why do you have 3 different say hooks?


yeah
If you put it all together, would not work perfectly
but at least works

Is there a problem?
Visit WorldQuality2D website: http://wq2d.com.br /// Upload your map at http://uploadwq2d.tk
28.04.12 08:20:57 pm
Up
Yates
User
Offline Off
user sheeL has written:
If you put it all together, would not work perfectly

This is wrong. It would.
28.04.12 08:21:30 pm
Up
Jynxxx
User
Offline Off
what was the problem with my script , mine is more cleaner and shorter what if he doesn't want the text !enable to show to everyone.

*edit*
the code really didnt need the array function

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
admincolor = 1

Admin = {18627}

addhook("say","adminsay")
function adminsay(id,txt)
     for _, usgn in ipairs(Admin) do
          if player(id,"usgn") == usgn then
               if txt=="!q" then
                    admincolor = 0
                    msg2(id,"adminchat removed")
                    return 1
               elseif txt=="!a" then
                    admincolor = 1
                    msg2(id,"adminchat activated")
                    return 1
               elseif admincolor == 1 then
                    msg("©255255255"..player(id,"name").." [Admin] : "..txt)
                    return 1
               end
          end
     end
end
edited 1×, last 28.04.12 08:23:39 pm
28.04.12 08:23:23 pm
Up
Yates
User
Offline Off
user Jynxxx has written:
what was the problem with my script

Your code will turn everyone's text on and off, and not just your own.
28.04.12 08:24:10 pm
Up
Jynxxx
User
Offline Off
your right about that
28.04.12 08:50:17 pm
Up
sheeL
User
Offline Off
user Yates has written:
user Jynxxx has written:
what was the problem with my script

Your code will turn everyone's text on and off, and not just your own.


works =='
Visit WorldQuality2D website: http://wq2d.com.br /// Upload your map at http://uploadwq2d.tk
29.04.12 01:31:15 pm
Up
Misho
User
Offline Off
I was thinking about:
!q works for off/on
Can you make it?
29.04.12 02:09:04 pm
Up
krabob
User
Offline Off
I got a feeling this should work

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
27
28
29
30
31
32
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end

admincolor=initArray(32)


addhook("say","adminsay")
function adminsay(id,txt)
for _, usgn in ipairs(Admin) do
if player(id,'usgn') == usgn then
if admincolor == 1 then
msg("©255255255"..player(id,"name").." [Admin] : "..txt)
end
if txt=="!q" then
if admincolor[id]==1 then
admincolor[id]=0
msg2(id,"adminchat removed")
return 1
elseif admincolor[id]==0 then
admincolor[id]= 1
msg2(id,"adminchat activated")
return 1
end
end
end
end
end
edited 1×, last 29.04.12 02:44:12 pm
People help the people
29.04.12 02:28:38 pm
Up
Yates
User
Offline Off
You forgot the admin's table. For the rest the code Kratos gave you should work.
29.04.12 02:48:52 pm
Up
Misho
User
Offline Off
user krabob has written:
I got a feeling this should work

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
27
28
29
30
31
32
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end

admincolor=initArray(32)


addhook("say","adminsay")
function adminsay(id,txt)
for _, usgn in ipairs(Admin) do
if player(id,'usgn') == usgn then
if admincolor == 1 then
msg("©255255255"..player(id,"name").." [Admin] : "..txt)
end
if txt=="!q" then
if admincolor[id]==1 then
admincolor[id]=0
msg2(id,"adminchat removed")
return 1
elseif admincolor[id]==0 then
admincolor[id]= 1
msg2(id,"adminchat activated")
return 1
end
end
end
end
end


I agree with user Yates i need the admin table.
To the start Previous 1 2 Next To the start