Hello, this is my first time I'm trying to do something in PRISM, so excuse my noobness.
Basically I'm trying to make a clickable button and then show a msg after clicking on that button, nothing more. My code:
And when I try to click that button, the console says:
... and the message does not get displayed.
I hope someone helps
Basically I'm trying to make a clickable button and then show a msg after clicking on that button, nothing more. My code:
<?php
class flame_test extends Plugins
{
const URL = 'http://lfsforum.net/forumdisplay.php?f=312';
const NAME = 'Flame Test';
const AUTHOR = 'Martin Kapal';
const VERSION = PHPInSimMod::VERSION;
const DESCRIPTION = 'Description';
public function __construct()
{
$this->registerPacket('onState', ISP_STA);
}
public function onState(IS_STA $STA)
{
IS_BTN()->UCID(0)->ClickID(2)->ReqI(1)->T(50)->L(50)->W(30)->H(10)->BStyle(ISB_DARK + ISB_LEFT + ISB_CLICK + 1)->Text('Test button')->registerOnClick($this, 'onBtnClick')->Send();
}
public function onBtnClick()
{
IS_MSX()->Msg('Clicked a button!')->Send();
}
}
?>
Error: Received click for unknown button!
object(IS_BTC)#10 (8) {
["Size":protected]=>
int(8)
["Type":protected]=>
&int(46)
["ReqI"]=>
int(1)
["UCID"]=>
int(0)
["ClickID"]=>
int(2)
["Inst"]=>
int(8)
["CFlags"]=>
int(1)
["Sp3":protected]=>
int(0)
}
array(0) {
}
... and the message does not get displayed.
I hope someone helps