Forum

> > CS2D > Scripts > Radio
Forums overviewCS2D overview Scripts overviewLog in to reply

English Radio

5 replies
To the start Previous 1 Next To the start

old Radio

Flame
BANNED Off Offline

Quote
How to make a lua when only admins say !radio [id] and send a pm and nobody will see it

old Re: Radio

Tajifun
User Off Offline

Quote
Create a table with the USGN of every admin,

1
ADMINS = {1,2732,39045}
use string.sub...

1
if string.sub(txt,1,6) == !radio then

and msg2, so only a certain player will see the message.

old Re: Radio

Tajifun
User Off Offline

Quote
I hope this works:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ADMINS = {1,245,8529} -- Admins right here


addhook("say","say_")
function say_(id,txt)
	for i = 1, 32 do
		if player(id,"usgn") == ADMINS[i] then
			if (string.sub(txt, 1, 6) == "!radio") then
				pl = string.sub(txt, 8, 9)
				msg = string.sub(txt, 10)
				if pl < "10" then 
					pl = string.sub(txt, 8, 8)
					msg = string.sub(txt, 10)
				end
				msg2(pl,""..player(id,"name").." [Private Message]: "..msg.."")
				return 1
			end
		end
	end
end

If anybody find a mistake, correct me!

old Re: Radio

Flame
BANNED Off Offline

Quote
But still ewerybody can see it

old Re: Radio

Kel9290
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ADMINS = {1,245,8529} -- Admins right here


addhook("say","say_")
function say_(id,txt)
	for i = 1, #player(0,"table") do
		if player(id,"usgn") == ADMINS[i] then
			if txt:sub(1,6) == "!radio" then
				pl = tonumber(txt:sub(8,9))
					msg = txt:sub(10)
					if pl < "10" then
						pl = tonumber(txt:sub(8,9))
					msg = txt:sub(10)
					end
			msg2(pl,player(id,"name").." [Private Message]: "..msg)
			return 1
			end
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview