Quote:
|
Originally Posted by projectigi
Hi,
NPC Code:
function onCreated(){
thiso.objtest=NULL;
thiso.objtest=new TStaticVar();
echo("before:" SPC thiso.objtest.test1);
thiso.objtest.test1="blah";
echo("after:" SPC thiso.objtest.test1);
findplayer("projectigi").triggerclient("-trgtest",thiso.objtest);
}
//#CLIENTSIDE
function onActionClientSide(){
player.chat="s" SPC params[0].test1;
}
don't works, is there any way to correctly pass an object through a triggeraction?
|
I have noticed this too. The only way I could partially do this was to do something like this:
PHP Code:
// In actionserverside
temp.varray = NULL;
for(temp.vname: this.objtest.getvarnames()) {
temp.varray.add(temp.vname @ "=" @ this.objtest.(temp.vname));
}
player.triggerclient("gui", "-trgtest", temp.varray);
PHP Code:
// In actionclientside
temp.varray.loadvarsfromarray(params[0]);
echo(temp.varray.test);