Author Topic: Continue Through Death?  (Read 623 times)

Ok im trying to make it so this code will continue through death any help?
Code: [Select]
function servercmdTownfolk(%client){
bottomPrintAll("\c2" @ %client.name @ " \c6 has become a Townfolk!",25,3);
%client.player.setshapename(%client.name SPC "[Is A " @ %client.Ranger @ "Townfolk]");

}

Code: [Select]
function serverCmdTownfolk(%client)
{
   bottomPrintAll("\c2" @ %client.name @ " \c6 has become a Townfolk!", 25, 3);
   %client.player.setShapeName(%client.name SPC "[Is a" SPC %client.Ranger SPC "Townfolk]");
}

You're problem is that when a player respawns, their name is reset (and doesn't include the "[Is a ___ Townsfolk]" part).

So logically, the solution would be to change the respawn function (I would use a package), so that when it respawns the player, it names them properly.

Here's the pseudo-code which I'll deliberately leave for you to finish:
Quote from: Code
package NameThemProperly
{
   function GameConnection::createPlayer(%client, %position)
   {
      Parent::createPlayer(%client, %position);
      if (%client.is_a_townsfolk)
         %client.setShapeName(%client.name SPC "[Is a" SPC %client.Ranger SPC "Townfolk]");
   }
};
activatePackage(NameThemProperly);
« Last Edit: May 27, 2008, 08:47:15 PM by exidyne »

Thank's Work's perfectly.