Forum

> > CS2D > Scripts > send privet msg
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch send privet msg

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: send privet msg

Cure Pikachu
User Off Offline

Zitieren
And looking at the actual version from that admin script, it's much more advanced.
This is just an edit of what user cs2d_is_a_Gem managed to dig up. Not really expecting this to work...
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
function totable(t,match)
	local cmd = {}
	if not match then
		match = "[%S]+"
	else
		match = "["..match.."]+"
	end
	for word in string.gmatch(t,match) do
		table.insert(cmd,word)
	end
	return cmd
end

addhook("say","sa")
function sa(id,txt)
	local t = totable(txt)
	if string.sub(t[1],1,1) == "!" then
		local pl = tonumber(string.sub(t[1],2))
		if player(pl,"exists") then
			if id ~= pl then
				local m = ""
				for i, v in ipairs(t) do
					if i == 2 then
						m = m..""..v
					elseif i > 2 then
						m = m.." "..v
					end
				end
				msg2(id,"©192128255To "..player(pl,"name")..": "..m)
				msg2(pl,"©192128255From "..player(id,"name")..": "..m)
			end
		end
		return 1
	end
end
2× editiert, zuletzt 12.05.18 21:14:43
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht