Author Topic: Event Request: IfGasMask  (Read 3879 times)

Oh golly, now I'm getting all excited~

Oh golly, now I'm getting all excited~
Ignore the snippet of code from earlier.

I re-wrote the entire thing, showed up and everything.

But the output doesn't register anything yet.

Almost done mate, hang in there


That code you posted on the last page is painful to look at...


you mis-defined a few variables, you have spare variables defined, and you were misusing functions...

glad you rewrote it

That code you posted on the last page is painful to look at...


you mis-defined a few variables, you have spare variables defined, and you were misusing functions...

glad you rewrote it
Lol thanks mate.
It was pretty bad.

But now I have it all working, but the checkMask isn't doing anything.


post it.

Code: [Select]
registerOutputEvent(fxDTSBrick, checkMask);
registerInputEvent(fxDTSBrick, "onMaskTrue", "Self fxDtsBrick\tPlayer Player\tClient GameConnection\tMinigame Minigame");
registerInputEvent(fxDTSBrick, "onMaskFalse", "Self fxDtsBrick\tPlayer Player\tClient GameConnection\tMinigame Minigame");

function fxDTSBrick::onMaskTrue(%this, %obj, %client)
{
$InputTarget_["Self"] = %obj;
$InputTarget_["Player"] = %client.player;
$InputTarget_["Client"] = %client;

if($Server::LAN)
   {
      $InputTarget_["MiniGame"] = getMiniGameFromObject(%client);
   }
   else
   {
      if(getMiniGameFromObject(%obj) == getMiniGameFromObject(%client))
         $InputTarget_["MiniGame"] = getMiniGameFromObject(%obj);
      else
         $InputTarget_["MiniGame"] = 0;
   }
%this.processInputEvent("onMaskTrue", %client);
}

function fxDTSBrick::onMaskFalse(%this, %obj, %client)
{
$InputTarget_["Self"] = %obj;
$InputTarget_["Player"] = %client.player;
$InputTarget_["Client"] = %client;

if($Server::LAN)
   {
      $InputTarget_["MiniGame"] = getMiniGameFromObject(%client);
   }
   else
   {
      if(getMiniGameFromObject(%obj) == getMiniGameFromObject(%client))
         $InputTarget_["MiniGame"] = getMiniGameFromObject(%obj);
      else
         $InputTarget_["MiniGame"] = 0;
   }
%this.processInputEvent("onMaskFalse", %client);
}

function fxDTSBrick::checkMask(%obj,%client)
{
if(%obj.client.Gasmask == 0)
{
if(%obj.getType() & $TypeMasks::PlayerObjectType && %obj.getState() !$= "Dead")
{
%db = %obj.getDatablock();

if(!%obj.isPlayer)
{
%this.onMaskFalse(%client);
}

else

{
%this.onMaskTrue(%client);
}
}
}
}

see: your coding help thread

also see ports post above mine

Bump~

Still no event :c

Bump~

Still no event :c

I haven't forgotten.
I'm trying to learn more about Torquescripts syntax and such.