ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/chat.ext
(Generate patch)

Comparing deliantra/maps/perl/chat.ext (file contents):
Revision 1.1 by pippijn, Sun May 7 07:54:15 2006 UTC vs.
Revision 1.2 by root, Sun May 7 07:57:04 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines