View Single Post
  #2  
Old 03-25-2006, 06:45 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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.vnamethis.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); 
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote