1 |
pippijn |
1.1 |
#! perl |
2 |
|
|
cf::register_command tell => 0, sub |
3 |
|
|
{ |
4 |
|
|
my ($who, $args) = @_; |
5 |
|
|
my ($target, $msg) = split /\s+/, $args, 2; |
6 |
|
|
|
7 |
|
|
my $name = $who->name; |
8 |
|
|
|
9 |
|
|
if (my $other = cf::player::find $target) |
10 |
|
|
{ |
11 |
|
|
if ($other->ob->{ext_ignore_tell}{$name} < time) { |
12 |
|
|
delete $other->ob->{ext_ignore_tell}{$name}; |
13 |
|
|
} |
14 |
|
|
if ($target ne $name and !$other->ob->{ext_ignore_tell}{$name}) { |
15 |
|
|
$who->message ("You tell $target: $msg"); |
16 |
|
|
$other->ob->message ("$name tells you: $msg"); |
17 |
|
|
} elsif ($target eq $name) { |
18 |
|
|
$who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); |
19 |
|
|
} else { |
20 |
|
|
$who->message ($other->ob->name." ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
21 |
|
|
} |
22 |
|
|
} |
23 |
|
|
else |
24 |
|
|
{ |
25 |
|
|
$who->message ("No such player or ambiguous name.", |
26 |
|
|
cf::NDI_UNIQUE); |
27 |
|
|
} |
28 |
|
|
} |