View Single Post
  #8  
Old 03-17-2007, 05:25 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Script in level..

PHP Code:
NPC 30 30
function onCreated()
{
  
setshape13232 );
  
ani "idle";
  
this.join("addon_interaction");
}

function 
onActionAddClass() this.join("interaction_" params[0].lower());

//#CLIENTSIDE
function onCreated()
{
  
// Initialize the attributes
  
showcharacter();
  
headimg "head0.png";
  
colors[0] = "orange";
  
colors[1] = "white";
  
colors[2] = "blue";
  
colors[3] = "red";
  
colors[4] = "black";
  
shieldimg "shield1.gif";
  
dir 2;
  
chat "Shop";
  
nick "Fred";

  
this.interaction = new TStaticVar();
  
this.interaction.say "Hello, what can I do for you?";
  
this.interaction.modes = { "Shop""Leave" };

  
this.shop = new TStaticVar();
  
this.shop.class = "fredshop";

  for (class: 
this.interaction.modestriggerAction(this.xthis.y"addClass", class);
}
NPCEND 
Script of interaction_shop..

PHP Code:
function onActionGetData()
{
  
triggerAction(xy"clientside""test");
}

//#CLIENTSIDE
function interactionShop()
{
  
Interaction_Menu.visible false;
  
triggerAction(this.xthis.y"GetData""");
}

function 
onActionClientSide()
{
  
chat "!";

The addon_interaction class calls the function "interactionShop" when the npc is clicked, and so far so good.. the action "GetData" is sent by the interaction _shop class BUT I cant send the data back from serverside to clientside no mather how I try..

I would preffer solving it with actions or something, I'd hate to have to use a timeout and attr's.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote