Author Topic: Making a slash command that sends a bottom print message to all players?  (Read 2695 times)

I'm making a Headcrab Zombie mod, and i wanted to make it so when someone types /Headcrab it sends a message to all players in the server a message in bottom print saying "*Player name* has become a Headcrab Zombie!"

Also, i could fit anything else into the topic title so here's the other question: How do i make it so the slash command also applies a certain face and torso decal to the player?

Headcrab Zombie mod
Ololol.

I'll write you one now :cookieMonster:

EDIT :
Code: [Select]
function serverCmdHeadcrab(%client)
{
bottomPrintAll(%client.name SPC "has become a headcrab zombie!",3,1);
//other stuff
}

Don't know about the decal stuff, though
« Last Edit: August 07, 2008, 06:08:10 PM by Headcrab Zombie »

^Proffesional headcrab^

Thanks, now all i need is that decal thing and it's done


Package GameConnection::ApplyBodyColors(%client) to check if the client has "isHeadcrabZombie" set, then use %client.player.setFaceName("DECAL FILENAME")/%client.player.setDecalName("DECAL FILENAME"). (filename = "AAA-None" for no torso decal, "smileyCreepy" for generic smiling face etc.)

Package GameConnection::ApplyBodyColors(%client) to check if the client has "isHeadcrabZombie" set, then use %client.player.setFaceName("DECAL FILENAME")/%client.player.setDecalName("DECAL FILENAME"). (filename = "AAA-None" for no torso decal, "smileyCreepy" for generic smiling face etc.)
Can that be put in a way i'd know how to put it into the headcrab script?

Code: [Select]
datablock ShapeBaseImageData(HeadcrabImage)
{
shapeFile = "./Shapes/Headcrab.dts";
emap = true;
mountPoint = $HeadSlot;
offset = "0 0.023 0.4";
eyeOffset = "0 0.023 0.4";
rotation = eulerToMatrix("0 0 0");
scale = "1 1 1";
doColorShift = false;
colorShiftColor = "1.000 1.000 1.000 1.000";
};

function serverCmdHeadcrab(%client)
{

bottomPrintAll(%client.name SPC "has become a headcrab zombie!",3,1);
//other stuff

%player = %client.player;

if(isObject(%player))
{
if(%player.getMountedImage(2) $= nametoID(HeadcrabImage))
{
%player.unmountImage(2);
%client.applyBodyParts();
%client.applyBodyColors();
}
else
{
%player.unmountImage(2);
%player.mountImage(HeadcrabImage,2);

for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
}
}
}
}

zombie decal I'm guessing?

zombie decal I'm guessing?
I have 2 zombie decals, both are named Zombie, i don't know if that is a problem, here's a screenshot of the headcrab and the decals



It changes the color of the entire body, but i think it looks a tad better like that, and yay for sucky Paint.NET skills, the headcrab also looks better in game, the top view of it seems as if i were playing HL2 or Gmod :D

Headcrab is... pretty lame and crap tbh.

I realize this, i knew i wasn't a good modeler, but hey, i get ideas for mods, i try to make em'

Package GameConnection::ApplyBodyColors(%client) to check if the client has "isHeadcrabZombie" set, then use %client.player.setFaceName("DECAL FILENAME")/%client.player.setDecalName("DECAL FILENAME"). (filename = "AAA-None" for no torso decal, "smileyCreepy" for generic smiling face etc.)
Can that be put in a way i'd know how to put it into the headcrab script?

Quote
datablock ShapeBaseImageData(HeadcrabImage)
{
   shapeFile = "./Shapes/Headcrab.dts";
   emap = true;
   mountPoint = $HeadSlot;
   offset = "0 0.023 0.4";
   eyeOffset = "0 0.023 0.4";
   rotation = eulerToMatrix("0 0 0");
   scale = "1 1 1";
   doColorShift = false;
   colorShiftColor = "1.000 1.000 1.000 1.000";
};

function serverCmdHeadcrab(%client)
{

   bottomPrintAll(%client.name SPC "has become a headcrab zombie!",3,1);
   //other stuff

   %player = %client.player;

   if(isObject(%player))
   {
      %player.isHCZombie = !%player.isHCZombie;
      if(%player.isHCZombie)
      {
         %player.unmountImage(2);
         %client.applyBodyParts();
         %client.applyBodyColors();
      }
      else
      {
         %player.unmountImage(2);
         %player.mountImage(HeadcrabImage,2);

         for(%i = 0;$hat[%i] !$= "";%i++)
         {
            %player.hideNode($hat[%i]);
            %player.hideNode($accent[%i]);
         }
      }
   }
}

package headCrabStuff
{
 function GameConnection::applyBodyColors(%this)
 {
  Parent::applyBodyColors(%this);
  if(isObject(%client.player) && %client.player.isHCZombie)
  {
   %client.player.setDecalName("Zombie");
   %client.player.setFaceName("Zombie");
   for(%i = 0;$hat[%i] !$= "";%i++)
   {
   %player.hideNode($hat[%i]);
   %player.hideNode($accent[%i]);
   }
   %player.setNodeColor("lhand","1 0 0 1");
   %player.setNodeColor("rhand","1 0 0 1");
   %player.setNodeColor("lhook","1 0 0 1");
   %player.setNodeColor("rhook","1 0 0 1");
   %player.setNodeColor("larm","0.5 0 0 1");
   %player.setNodeColor("rarm","0.5 0 0 1");
  }
 }
};activatePackage(headCrabStuff);
Try that and see how it works.

 Try using Jirue's body, that'd look better.

Hmm, here's how it's setup for v9

Script_Headcrab.zip
Headcrab.dts
tan.blank.jpg
description.txt
server.cs (Originally Script_Headcrab.cs)

Decal_Zombie
Zombie.png
thumbs\Zombie.png

Face_Zombie
Zombie.png
thumbs\Zombie.png

Code: [Select]
datablock ShapeBaseImageData(HeadcrabImage)
{
   shapeFile = "Add-Ons/Script_Heacrab/Headcrab.dts";
   emap = true;
   mountPoint = $HeadSlot;
   offset = "0 0.023 0.4";
   eyeOffset = "0 0.023 0.4";
   rotation = eulerToMatrix("0 0 0");
   scale = "1 1 1";
   doColorShift = false;
   colorShiftColor = "1.000 1.000 1.000 1.000";
};

function serverCmdHeadcrab(%client)
{

   bottomPrintAll(%client.name SPC "has become a headcrab zombie!",3,1);
   //other stuff

   %player = %client.player;

   if(isObject(%player))
   {
      %player.isHCZombie = !%player.isHCZombie;
      if(%player.isHCZombie)
      {
         %player.unmountImage(2);
         %client.applyBodyParts();
         %client.applyBodyColors();
      }
      else
      {
         %player.unmountImage(2);
         %player.mountImage(HeadcrabImage,2);

         for(%i = 0;$hat[%i] !$= "";%i++)
         {
            %player.hideNode($hat[%i]);
            %player.hideNode($accent[%i]);
         }
      }
   }
}

package headCrabStuff
{
 function GameConnection::applyBodyColors(%this)
 {
  Parent::applyBodyColors(%this);
  if(isObject(%client.player) && %client.player.isHCZombie)
  {
   %client.player.setDecalName("Zombie");
   %client.player.setFaceName("Zombie");
   for(%i = 0;$hat[%i] !$= "";%i++)
   {
   %player.hideNode($hat[%i]);
   %player.hideNode($accent[%i]);
   }
   %player.setNodeColor("lhand","1 0 0 1");
   %player.setNodeColor("rhand","1 0 0 1");
   %player.setNodeColor("lhook","1 0 0 1");
   %player.setNodeColor("rhook","1 0 0 1");
   %player.setNodeColor("larm","0.5 0 0 1");
   %player.setNodeColor("rarm","0.5 0 0 1");
  }
 }
};activatePackage(headCrabStuff);

I typed /headcrab in the game, it just said "Masterlegodude has become a headcrab zombie!" no hat appears, and no decals appear on my torso or face

Using the Add-Ons/????_NAME path is how i got my other mods to work so far

zombie decal I'm guessing?
I have 2 zombie decals, both are named Zombie, i don't know if that is a problem, here's a screenshot of the headcrab and the decals

[img]

It changes the color of the entire body, but i think it looks a tad better like that, and yay for sucky Paint.NET skills, the headcrab also looks better in game, the top view of it seems as if i were playing HL2 or Gmod :D
I thought the Headcrab COVERED the head o.o