public function priv_pizza($line, $args) { if ($args['nargs'] < 1) { $this->ircClass->privMsg($line['to'], chr(2).'Usage'.chr(2).': !pizza <time> , in minutes, 0<'.chr(2).'x'.chr(2).'<=240'); return; } if (!is_numeric($args['arg1'])) { $this->ircClass->privMsg($line['to'], chr(2).'Usage'.chr(2).': !pizza <time> , in minutes, 0<'.chr(2).'x'.chr(2).'<=240'); return; } $args['arg1']++; $args['arg1']--; if (!is_integer($args['arg1'])) { $this->ircClass->privMsg($line['to'], chr(2).'Usage'.chr(2).': !pizza <time> , in minutes, integer, 0<'.chr(2).'x'.chr(2).'<=240'); return; } if ($args['arg1']>240) { $this->ircClass->privMsg($line['to'], chr(2).'Usage'.chr(2).': !pizza <time> , in minutes, integer, 0<'.chr(2).'x'.chr(2).'<=240'); return; } $pizza_id = "pizza_". irc::randomhash(); $time = $args['arg1'] *60; $this->timerClass->addTimer($pizza_id, $this, "pizzaRemind", $line, $time, false); $this->ircClass->privMsg($line['to'], $line['fromNick'].", you will be notified at ".date("d.m.y, H:i", time()+$time).", ".$args['arg1']. " minutes from now"); }