Okay, so i've backed up the files this time, i want to make it so it's an item, but also i slash command, but it ain't showing up in the add-ons list, now, i knew this wouldn't work somehow, so i didn't expect this to work, all i did was copy and paste a lot of stuff
//Headcrab.cs
//////////
// item //
//////////
datablock ItemData(HeadcrabItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "Add-Ons/Script_Headcrab/Headcrab.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "Headcrab";
iconName = "Add-Ons/Script_Headcrab/icon_Headcrab";
doColorShift = false;
colorShiftColor = "0.25 0.25 0.25 1.000";
// Dynamic properties defined by the scripts
image = HeadcrabImage;
canDrop = true;
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(HeadcrabImage)
{
// Basic Item properties
shapeFile = "Add-Ons/Script_Headcrab/Headcrab.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0;
offset = "0 0 -0.39";
rotation = eulerToMatrix("-90 90 0");
eyeOffset = "0 0 0.1";
eyeRotation = eulerToMatrix("90 -90 0");
// When firing from a point offset from the eye, muzzle correction
// will adjust the muzzle vector to point to the eye LOS point.
// Since this weapon doesn't actually fire from the muzzle point,
// we need to turn this off.
correctMuzzleVector = true;
// Add the WeaponImage namespace as a parent, WeaponImage namespace
// provides some hooks into the inventory system.
className = "WeaponImage";
// Projectile && Ammo.
item = HeadcrabItem;
//melee particles shoot from eye node for consistancy
melee = false;
//raise your arm up or not
armReady = true;
doColorShift = false;
colorShiftColor = HeadcrabItem.colorShiftColor;//"0.400 0.196 0 1.000";
//casing = " ";
// Images have a state system which controls how the animations
// are run, which sounds are played, script callbacks, etc. This
// state system is downloaded to the client so that clients can
// predict state changes and animate accordingly. The following
// system supports basic ready->fire->reload transitions as
// well as a no-ammo->dryfire idle state.
// Initial start up state
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1] = true;
stateName[2] = "Fire";
stateTransitionOnTriggerUp[2] = "Ready";
stateScript[2] = "onFire";
};
function HeadcrabImage::onFire(%this,%obj,%slot)
{
bottomPrintAll(%client.name SPC "\c2is no longer 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();
%player.unHideNode(headskin);
}
else
{
%player.unmountImage(2);
%player.mountImage(HeadcrabImage,2);
bottomPrintAll(%client.name SPC "has become a headcrab zombie!",3,1);
for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
%player.hideNode(headskin);
}
}
}
}
function serverCmdHeadcrab(%client)
{
bottomPrintAll(%client.name SPC "\c2is no longer 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();
%player.unHideNode(headskin);
}
else
{
%player.unmountImage(2);
%player.mountImage(HeadcrabImage,2);
bottomPrintAll(%client.name SPC "has become a headcrab zombie!",3,1);
for(%i = 0;$hat[%i] !$= "";%i++)
{
%player.hideNode($hat[%i]);
%player.hideNode($accent[%i]);
%player.hideNode(headskin);
}
}
}
}