From: Michael Andreen Date: Sun, 9 Sep 2007 15:25:40 +0000 (+0200) Subject: Updated addPoints X-Git-Url: https://ruin.nu/git/?a=commitdiff_plain;h=a57f94a968f33e287a26fbb8c9e97c11b0966b67;hp=9b9f9324f849f89d812a73e6f7fdc36205b24e92;p=NDIRC.git Updated addPoints --- diff --git a/Usermgm.pm b/Usermgm.pm index 332a9e1..83c27ca 100644 --- a/Usermgm.pm +++ b/Usermgm.pm @@ -192,16 +192,21 @@ sub getShips { } sub addPoints { - my ($t,$nick,$p) = @_; - DB(); + my ($msg, $t) = @_; + + my ($nick, $points); + if(defined $msg && $msg =~ /^(\S+)(?: (-?\d+))?$/){ + $nick = $1; + $points = $2; + }else{ + $ND::server->command("notice $ND::nick syntax: .$t nick [points] | % can be used for wildcards \%arro\% will match barrow, if the number of points isn't specified, then 1 will be assumed."); + return; + } if ( ($t eq "d" && dc()) || ($t eq "a" && bc()) || ($t eq "h" && officer()) || ($t eq "s" && scanner())){ - my $points = 1; - if ($p){ - $points = $p; - } + $points = 1 unless (defined $points); if ($points*$points > 400){ $ND::server->command("msg $ND::target Values between -20 and 20 please"); return;