… | |
… | |
33 | # and time in the format of 2006-05-19 03:21:31 UTC instead of 1148001691 |
33 | # and time in the format of 2006-05-19 03:21:31 UTC instead of 1148001691 |
34 | # seconds since 1970-01-01 00:00:00 UTC. |
34 | # seconds since 1970-01-01 00:00:00 UTC. |
35 | sub balance { |
35 | sub balance { |
36 | my ($who, $is_wiz) = @_; |
36 | my ($who, $is_wiz) = @_; |
37 | my $balance = $who->{bank_balance}; |
37 | my $balance = $who->{bank_balance}; |
|
|
38 | warn "BALA $balance<<\n"; |
38 | |
39 | |
39 | unless ($is_wiz) { |
40 | unless ($is_wiz) { |
40 | return "Sorry, you have no balance." |
41 | return "Sorry, you have no balance." |
41 | unless $balance >= 1; |
42 | unless $balance >= 1; |
42 | } else { |
43 | } else { |
… | |
… | |
149 | } elsif ($currency eq "royalties") { |
150 | } elsif ($currency eq "royalties") { |
150 | $currency = "royalty"; |
151 | $currency = "royalty"; |
151 | } |
152 | } |
152 | |
153 | |
153 | if ($cmd eq "balance") { |
154 | if ($cmd eq "balance") { |
154 | if ($who->flag (cf::FLAG_WIZ)) { |
155 | if ($who->flag (cf::FLAG_WIZ) && $arguments =~ /\S/) { |
|
|
156 | cf::async { |
155 | if (my $player = cf::player::find $arguments) { |
157 | if (my $player = cf::player::find $arguments) { |
156 | $who->reply ($npc, balance $player->ob, 1); |
158 | $who->contr->send_msg ( |
|
|
159 | $ext::chat::SAY_CHANNEL, "Nancy says: " . balance ($player->ob, 1), |
|
|
160 | cf::NDI_BROWN | cf::NDI_REPLY |
|
|
161 | ) if $who->contr; |
|
|
162 | } |
157 | } |
163 | }; |
158 | } else { |
164 | } else { |
159 | $who->reply ($npc, balance $who, 0); |
165 | $who->reply ($npc, balance ($who, 0)); |
160 | } |
166 | } |
161 | |
167 | |
162 | } elsif ($cmd eq "balance" and !$arguments) { |
168 | } elsif ($cmd eq "balance" and !$arguments) { |
163 | $who->reply ($npc, "Balance of whom?"); |
169 | $who->reply ($npc, "Balance of whom?"); |
164 | |
170 | |