Back Reply to topic
Goto page Previous  1, 2
Chaly 
Offizier · Webmaster 
Topics: 404
Posts: 2107
Location: Bad Honnef
Playing:  Guildwars2 (Drakkar See)
Ingame:  Chaly Flavour
Years registered: * * * * * * * * * * * * * * * * * * * * * * *
Posted: Post 11:30 Sun - Oct 12, 2008

Dustie wrote:

I think there is an error in the 5 line , where the output $msg say : get $max .

sorry -.- copy&paste bug..
Code:
<?php
if ($pluginwords[1]=="!random") {
   $lbound = 1;
   $ubound = ($pluginwords[2]+0 > 1) ? $pluginwords[2] : 100;
   $msg="$sender rolls and gets " . mt_rand($lbound,$ubound) . " out of $ubound";
   send_reply(colortext($msg));
}
?>

i used the mt_rand() this time, code works for me
Reply with quote



_________________

Chalys Gimpnesstheory (2003) Die Theorie der expotentiellen Bullshits den Gimps bei gleichbleibendem Anteil produzieren.
xdave78 
Blue-Ribbon Chicken 
Topics: 1
Posts: 4
Playing:  AoC
Ingame:  Apokh
Years registered: * * * * * * * * * * * * * * * * *
Posted: Post 08:10 Thu - Feb 12, 2009

Still doesnt work as intended -.-

It is still rolling out of 100.
Reply with quote


Mika 
Champion Chicken 
Topics: 6
Posts: 67
Location: Finland
Playing:  AOC
Ingame:  Phaestyriade
Years registered: * * * * * * * * * * * * * * * * *
Posted: Post 03:34 Fri - Feb 20, 2009

Got mine working good strichauge Reply with quote


Kerv 
Blue-Ribbon Chicken 
Topics: 0
Posts: 8
Playing:  Fury
Ingame:  Kervo
Years registered: * * * * * * * * * * * * * * * * *
Posted: Post 11:21 Sat - Aug 29, 2009

that way it works!

Code:
<?php
if ($pluginwords[1]=="!roll") {
   $msg=substr($pluginmessage,strlen($pluginwords[1]));
   if ($msg>1) {
      $maxw=intval($msg);
   } else {
      $maxw=100;
   }
   $wurf=rand(1,$maxw);
   $msg="$sender" . " " . "würfelt" . " " . "$wurf" . " " . "von $maxw";
   send_reply(colortext($msg));
}
?>
Reply with quote


Goto page Previous  1, 2
Back Reply to topic