<?php
php
class table extends Plugins
{
const NAME = 'Table Plugin Example';
const AUTHOR = 'misiek08';
const VERSION = PHPInSimMod::VERSION;
const DESCRIPTION = 'Plugin to generate button table. Can be used for showing results or other info.';
private $data = array(array('test', 'test2', 'test3'),array('teste', 'teste2', 'teste3'),array('tester', 'tester2', 'tester3'));
private $header = array('1st', '2nd', '3rd');
private $width = 10;
private $height = 8;
private $x = 50;
private $y = 50;
/* Remember about this:
define('IS_X_MIN', 0);
define('IS_X_MAX', 110);
define('IS_Y_MIN', 30);
define('IS_Y_MAX', 170);
*/
public function __construct()
{
$this->registerSayCommand('prism table', 'cmdTable', "Shows defined in code table for used.");
}
public function cmdTable($Msg, $UCID, $packet)
{
$cols = count($this->header);
$rows = count($this->data);
$id = 70;
for($i = 0; $i < $rows; $i++){
for($j = 0; $j < $cols; $j++){
$this->createButton($UCID,
$id,
(($j + 1) * $this->width) + $this->x,
(($i + 1) * $this->height) + $this->y,
$this->width,
$this->height,
$this->data[$i][$j]);
$id ++;
echo (($i + 1) * $this->height) + $this->y . PHP_EOL;
}
}
return PLUGIN_HANDLED;
}
private function createButton($ucid, $id, $x, $y, $w, $h, $text){
$btn = new IS_BTN();
$btn->UCID($ucid)
->L($x)
->T($y)
->ClickID($id)
->W($w)
->H($h)
->Text($text)
->Send();
}
}
?>
<?php
$pst = $SDK->get_pst('juniox_dias');
?>
<?php
$racers = array('benten' => array(25, 150000, 'XFG'), 'boothy' => array(24, 149900, 'XRG'), 'Dygear' => array(25, 147800, 'FXO'));
?>
<?php
$classes = array('TBO' => 'FXO,XRT', 'STD' => 'XFG,XRG');
?>
<?php
$classes = array('TBO' => array('FXO','XRT'), 'STD' => array('XFG','XRG'));
?>