]> ruin.nu Git - NDIRC.git/commitdiff
Updated addPoints
authorMichael Andreen <harv@ruin.nu>
Sun, 9 Sep 2007 15:25:40 +0000 (17:25 +0200)
committerMichael Andreen <harv@ruin.nu>
Sun, 9 Sep 2007 15:25:40 +0000 (17:25 +0200)
Usermgm.pm

index 332a9e1fa6796d5be961662139edd273bc2fe817..83c27ca0681bd19111f68c305a887b0921ce313f 100644 (file)
@@ -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;