Author Topic: Message all problems  (Read 1453 times)

I was porting an older map that has a kill trigger that is supposed to message all that the player died when ever you enter the trigger.  However when ever I enter the trigger only the death message is displayed with out the players name and sense I have very little coding knowledge I decided to post here for help.

Here's the trigger function:
Code: [Select]
function BLGrillTrigger::onEnterTrigger( %this, %trigger, %obj )
{
   if (!%obj.client)
      return;
   %messageArray[0] = "\c2" @ %obj.client.namebase @ " just decided to sleep with the coals.";
   %messageArray[1] = "\c2" @ %obj.client.namebase @ " decided to go for well-done.";
   %messageArray[2] = "\c2" @ %obj.client.namebase @ " likes it HOT.";
   %messageArray[3] = "\c2" @ %obj.client.namebase @ " fails at walking on hot coals.";
   %messageArray[4] = "\c2" @ %obj.client.namebase @ " IS ON FIRE!!!";
   %messageArray[5] = "\c2" @ %obj.client.namebase @ " turned into a plastic puddle.";
   %messageArray[6] = "\c2" @ %obj.client.namebase @ " says, 'That's hot.'";
   %messageArray[7] = "\c2" @ %obj.client.namebase @ " decided to go down in flames.";
   %messageArray[8] = "\c2" @ %obj.client.namebase @ " made like Gollum and the One Ring.";
   %messageArray[9] = "\c2" @ %obj.client.namebase @ " is now available in Flame-Broiled or Extra Crispy.";
   messageAll('SomeDumarseFellIntoTheGrill', %messageArray[getRandom(0,9)]);
   %obj.kill();
}

Unless there's a blockland-specific error, I don't see anything wrong with your code. But, I would use %obj.client.name rather than %obj.client.namebase:

Code: [Select]
function BLGrillTrigger::onEnterTrigger(%this, %trigger, %obj)
{
   if( !isObject(%obj.client) )
      return;

   %messageArray[0] = '\c2%1 just decided to sleep with the coals.';
   %messageArray[1] = '\c2%1 decided to go for well-done.';
   %messageArray[2] = '\c2%1 likes it HOT.';
   %messageArray[3] = '\c2%1 fails at walking on hot coals.';
   %messageArray[4] = '\c2%1 IS ON FIRE!!!';
   %messageArray[5] = '\c2%1 turned into a plastic puddle.';
   %messageArray[6] = '\c2%1 says, \'That\'s hot.\'';
   %messageArray[7] = '\c2%1 decided to go down in flames.';
   %messageArray[8] = '\c2%1 made like Gollum and the One Ring.';
   %messageArray[9] = '\c2%1 is now available in Flame-Broiled or Extra Crispy.';

   messageAll('SomeDumarseFellIntoTheGrill', %messageArray[ getRandom(0,9) ], %obj.client.name);
   %obj.kill();
}
« Last Edit: April 27, 2008, 08:26:55 PM by exidyne »

That worked thanks. :cookie:

Make it kill vehicles so that they don't fall in and are in an unreachable place.

Its an old TBM map that Luquado (sp) made so I didn't code it, or would know how to code it.  Anyway the area with the trigger is to small for a vehicle.
« Last Edit: April 28, 2008, 12:27:31 AM by adc90 »