ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/chat.ext
Revision: 1.3
Committed: Sun May 7 08:00:46 2006 UTC (18 years ago) by pippijn
Branch: MAIN
Changes since 1.2: +10 -8 lines
Log Message:
Improved with hint from schmorp.

File Contents

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