Author Topic: Notification Popup  (Read 2998 times)

You're mixing client and server-sided code.

GameConnection::onDeath is server-sided.

You're mixing client and server-sided code.

GameConnection::onDeath is server-sided.
How I am going fix it? the script in client.cs

Anybody??? I need finish on this script is almost finish.

First of all you need to put it in a server.cs into a server_NAMEHERE. Other than client.

I don't know where it is found but here is how you use you notification stuff. Nothing else.

RTBCC_NotificationManager.pus h("TitleHere","MessageHere","IconNameHere");

First of all you need to put it in a server.cs into a server_NAMEHERE. Other than client.

I don't know where it is found but here is how you use you notification stuff. Nothing else.

RTBCC_NotificationManager.pus h("TitleHere","MessageHere","IconNameHere");

Pacnet2012 wrote on his post
http://forum.blockland.us/index.php?topic=235287.msg6699591#msg6699591

and I will rename them then test it.

Pacnet2012 wrote on his post
http://forum.blockland.us/index.php?topic=235287.msg6699591#msg6699591

and I will rename them then test it.
Alright, you can do that too. But the code you have right now is mostly useless if you are doing it client sided.

Alright, you can do that too. But the code you have right now is mostly useless if you are doing it client sided.
Quote
RTBCC_NotificationManager.push(%menuIcon[%menuItems++] = "skull16", %user.name, %client, %killerPlayer, %killer, %damageType, %damageLoc, "user",%user.id);-1);
Nothing work, I forget remove ); at end but I did use your
Quote
RTBCC_NotificationManager.push("TitleHere","MessageHere","IconNameHere");
are worked.

Update Edit:

YES! almost worked, but werid why Icon information on the popup? I doesn't put it there... and still blank.
Quote
package NotificationPopUp
{
function GameConnection::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc)
{
   Parent::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc);
      if(RTBCO_getPref("CC::Message::Note"))
      {
         %detagged = detag(%tag);
         %det = detag(%msg);
         if(%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled")
         {
            if($DeathCounts == 5)
            {
               for(%x=1;%x<=4;%x++)
                  $Death[%x] = $Death[%x+1];
               $Death5 = %det;
            }
            else
               $Death[$DeathCounts++] = %det;
            %deathMessage = $Death1;
            for(%x=2;%x<=$DeathCounts;%x++)
               %deathMessage = %deathMessage NL $Death[%x];
            newDeathText.setText(%deathMessage);
            return;
         }
         else
            RTBCC_NotificationManager.pus h(%this,%title,%message,%icon,%key,%user.name,"MsgYourDeath",%death,"MsgClientKilled","user",%user.id,-1);
      }
   }
};
activatePackage(NotificationPopUp);

Update Edit 2:


Quote
RTBCC_NotificationManager.push(%this,%title,%message,%icon,%key,%user.name,"MsgYourDeath",%death,"MsgClientKilled","user",%user.id,-1);
change to
Quote
RTBCC_NotificationManager.push(%this,%message,%user.name,"MsgYourDeath",%death,"MsgClientKilled","user",%user.id,-1);
« Last Edit: September 09, 2013, 05:48:10 PM by Furling² »

I am frustrated with this the code. I can't figure it out... script hard for me,  I had learn the code on the script. I spend all day work on this the code. I really need break time...

HandleClientDeath would be a better option, though.
Quote
Entering [buildbot]clientCmdServerMessage(80 MsgClientKilled, 84 Vexsume <bitmap:add-ons/Weapon_butterflyknife/CI_butterflyknife> Eren, Eren, Vexsume)
   Entering clientCmdServerMessage(80 MsgClientKilled, 84 Vexsume <bitmap:add-ons/Weapon_butterflyknife/CI_butterflyknife> Eren, Eren, Vexsume, , , , , , , , )
      Entering defaultMessageCallback(80 MsgClientKilled, 84 Vexsume <bitmap:add-ons/Weapon_butterflyknife/CI_butterflyknife> Eren, Eren, Vexsume, , , , , , , , )
         Entering onServerMessage(Vexsume <bitmap:add-ons/Weapon_butterflyknife/CI_butterflyknife> Eren)
            Entering newChatHud_AddLine(Vexsume <bitmap:add-ons/Weapon_butterflyknife/CI_butterflyknife> Eren)
               Entering NewChatSO::addLine(12928, Vexsume <bitmap:add-ons/Weapon_butterflyknife/CI_butterflyknife> Eren)
                  Entering NewChatSO::displayLatest(12928)
                     Entering newMessageHud::updatePosition(newMessageHud)
                     Leaving newMessageHud::updatePosition() - return
                     Entering newChatHud_UpdateScrollDownIn dicator()
                        Entering newChatHud_UpdateIndicatorPos ition()
                        Leaving newChatHud_UpdateIndicatorPos ition() - return
                     Leaving newChatHud_UpdateScrollDownIn dicator() - return
                  Leaving NewChatSO::displayLatest() - return
               Leaving NewChatSO::addLine() - return
               Entering newMessageHud::updatePosition(newMessageHud)
               Leaving newMessageHud::updatePosition() - return
               Entering newChatHud_UpdateScrollDownIn dicator()
                  Entering newChatHud_UpdateIndicatorPos ition()
                  Leaving newChatHud_UpdateIndicatorPos ition() - return
               Leaving newChatHud_UpdateScrollDownIn dicator() - return
            Leaving newChatHud_AddLine() - return
         Leaving onServerMessage() - return
      Leaving defaultMessageCallback() - return
   Leaving clientCmdServerMessage() - return
Leaving [buildbot]clientCmdServerMessage() - return
Can't see that function being called, are you sure it's client-sided?

attached console log.

I fixed your code by removing all the garbage from it and then adding new working code.

Code: [Select]
package crap
{
function clientCmdServerMessage(%tag, %msg, %a, %b, %c, %d, %e, %f, %g, %h, %i, %j)
{
parent::clientCmdServerMessage(%tag, %msg, %a, %b, %c, %d, %e, %f, %g, %h, %i, %j);
%detag = detag(%tag);
if(%detag $= "MsgClientKilled")
{
if(%b $= "")
RTBCC_NotificationManager.push(%a,"","skull-32","",5000);
else if(%a !$= %b)
RTBCC_NotificationManager.push(%a,"by " @ %b,"skull-32","",5000);
else
RTBCC_NotificationManager.push(%a,"","skull-32","",5000);
}
else if(%detag $= "MsgYourDeath")
{
if(%b $= $Pref::Player::NetName)
RTBCC_NotificationManager.push("You got killed","by yourself...","skull-32","",5000);
else if(%b !$= "")
RTBCC_NotificationManager.push("You got killed","by " @ %b,"skull-32","",5000);
else
RTBCC_NotificationManager.push("You died","","skull-32","",5000);
}
}
};activatepackage(crap);

Though it's not perfect.