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