Author Topic: Output event list  (Read 549 times)

Ok lets say I have an output event with list apple 0 cherry 1 orange 2.

How would I get it to say the name of the fruit instead of 0 1 or 2 in a message?

Code: [Select]
switch$(%fruit)
{
 case 0:
  %string = "apple";
 case 1:
  %string = "cherry";
 case 2:
  %string = "orange";
}
[do stuff with %string]

Thanks you rock :D

Can you get this to work? I ran it and it said it stops right at the end of consuming portion text

Code: [Select]
function fxDTSBrick::SellFood(%this,%name,%cost,%size,%client)
{

switch$(%size)
{
 case 0:
  %string = "Small";
 case 1:
  %string = "Medium";
 case 2:
  %string = "Large";
}

  if($asking == false)
  {
  $asking = true;
  messageClient(%client,'',"\c6This service is offering you a \c3" @ %string SPC"\c6portion of \c3" @ %name SPC"\c6for \c3$" @ %cost @ "\c6. Say \c3^yes \c6to accept or \c3^no \c6to decline.");
  }
  else
  {
  messageClient(%client,'',"\c6You haven't answered your last offer yet!");
 
  return;
  }
 
  if($answer == true && CityRPData.getData(%client.bl_id).valuemoney >= %cost)
  {
  CityRPData.getData(%client.bl_id).valuemoney -= %cost;
  CityRPData.getData(%client.bl_id).valuehungerval += %size;
  messageClient(%client,'',"\c6You consume a \c3" @ %string SPC "\c6portion of \c3" @ %name @ "\c6.";
  }
  else if($answer == true && CityRPData.getData(%client.bl_id).valuemoney < %cost)
  {
  messageClient(%client,'',"You don't have enough money to buy this product!");
  return;
  }
 
 
}
« Last Edit: April 05, 2009, 06:57:02 AM by Pew446 »

I know it's big, but I'm not too much of a torque scripter so I don't know if it's right or not...

Got it
« Last Edit: April 05, 2009, 05:36:36 PM by Pew446 »