Forum

> > CS2D > Scripts > Radio
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Radio

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Radio

Flame
BANNED Off Offline

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

alt Re: Radio

Tajifun
User Off Offline

Zitieren
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.

alt Re: Radio

Tajifun
User Off Offline

Zitieren
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!

alt Re: Radio

Flame
BANNED Off Offline

Zitieren
But still ewerybody can see it

alt Re: Radio

Kel9290
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht