ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/chat.ext
Revision: 1.1
Committed: Sun May 7 07:54:15 2006 UTC (18 years ago) by pippijn
Branch: MAIN
Log Message:
Implemented chat/shout in perl with ignore.

File Contents

# Content
1 #! perl
2 cf::register_command chat => 0, sub
3 {
4 my ($who, $msg) = @_;
5
6 if ($msg) {
7 my $name = $who->name;
8
9 my $player = cf::player::first;
10 while ($player) {
11 unless ($player->ob->{ext_ignore_shout}) {
12 $player->ob->message ("$name chats: $msg", cf::NDI_BLUE);
13 }
14 $player = cf::player::next $player;
15 }
16 } else {
17 $who->message ("Chat what?", cf::NDI_UNIQUE);
18 }
19 };
20
21 cf::register_command shout => 0, sub
22 {
23 my ($who, $msg) = @_;
24
25 if ($msg) {
26 my $name = $who->name;
27
28 my $player = cf::player::first;
29 while ($player) {
30 unless ($player->ob->{ext_ignore_shout}) {
31 $player->ob->message ("$name shouts: $msg", cf::NDI_RED);
32 }
33 $player = cf::player::next $player;
34 }
35 } else {
36 $who->message ("Shout what?", cf::NDI_UNIQUE);
37 }
38
39 };