Forum

> > CS2D > Scripts > How to make invisible message?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to make invisible message?

3 replies
To the start Previous 1 Next To the start

old How to make invisible message?

udejo
User Off Offline

Quote
I gonna make something like this:

If PlayerA say "!kill", playerB dont see this message

But i dont know how to do this, can you help me with it?

old Re: How to make invisible message?

DC
Admin Off Offline

Quote
Use the cs2d lua hook say hook.
1
2
3
4
5
6
7
addhook("say","saystuff")
function saystuff(p,txt)
	if (txt=="!kill") then
		parse("killplayer " .. p)
		return 1
	end
end

return 1
is the important part. It prevents that the chat message is displayed/sent to other players.

parse("killplayer " .. p)
is just what I assumed you want to do. You can replace that part with whatever you want.

old Re: How to make invisible message?

Bowlinghead
User Off Offline

Quote
Many admin/chat scripts uses that mechanic to highlight VIP-messages:


1
2
3
4
5
6
7
addhook("say","saystuff")
function saystuff(id,txt)
     if (player(id,"usgn") == 51028) then
          msg("Bowlinghead [SuperCool]: "..txt);
          return 1;
     end
end

old Re: How to make invisible message?

Komo the Cat
User Off Offline

Quote
Maybe you can use "msg2" for clientsided message.

1
2
3
4
5
6
7
addhook("say","sayFunc")
function sayFunc(id, txt)
     if (txt == "!kill") then
          msg2(id, "Kill "..player(id, "name"))
          parse("killplayer "..id)
     end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview