Every want to make your own Half-Life Mod but never could find all of the right tools, or tutorials or even the models and prefabs you wanted to make it? Now you can in this small (about 350 mb or more) kit. This kit has every thing you need to make a simple or advance mod. The newest version contains modeling tools, reskining tools, texture making tools, map making tools, and much more. Also it updates every once in a while with new programs, models, tutorials, etc that I find around. The next version is even going to have custom dlls (engines) that you can use if your not a good coder, these will feature some new weapons, monsters, pickups etc. If you want to make a Half-Life mod you should really try this. If you do like it please review it and leave a comment, it is appreciated. It is very important to note though that I did not make most of this stuff, I mainly made the tutorials and coded the new dll, all the other stuff is made by truly remarkable people and they deserve the credit. Check out halflifemoddingkit.weebly.com for update news and more. NEW: I am slowly uploading the tutorials to halflifemoddingkit.weebly.com they are in a better format here and the code is color coded

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Post article RSS Articles

CS STYLE USP : SERVER SIDE

Server Side Coding Tutorial
FYI: Im the guy who created the iron sight tutorial. Just using a different account
Visual Studio 2006
Alright create a new file called usp.cpp (or whatever you want) and paste this inside:


/***
*
*	Copyright (c) 1996-2001, Valve LLC. All rights reserved.
*	
*	This product contains software technology licensed from Id 
*	Software, Inc. ("Id Technology").  Id Technology (c) 1996 Id Software, Inc. 
*	All Rights Reserved.
*
*   Use, distribution, and modification of this source code and/or resulting
*   object code is restricted to non-commercial enhancements to products from
*   Valve LLC.  All other use, distribution, or modification is prohibited
*   without written permission from Valve LLC.
*
****/

// USP Code By BlueNightHawk

#include "extdll.h"
#include "util.h"
#include "cbase.h"
#include "monsters.h"
#include "weapons.h"
#include "nodes.h"
#include "player.h"

enum usp_e {
	USP_IDLE1 = 0,
	USP_SHOOT1,
	USP_SHOOT2,
	USP_SHOOT3,
	USP_SHOOT_EMPTY,
	USP_RELOAD,
	USP_DRAW,
	USP_ADD_SILENCER,
	USP_IDLE1_U,
	USP_SHOOT1_U,
	USP_SHOOT2_U,
	USP_SHOOT3_U,
	USP_SHOOT_EMPTY_U,
	USP_RELOAD_U,
	USP_DRAW_U,
	USP_DETACH_SILENCER
};

LINK_ENTITY_TO_CLASS( weapon_usp, CUSP );

void CUSP::Spawn( )
{
	pev->classname = MAKE_STRING("weapon_usp"); // hack to allow for old names
	Precache( );
	m_iId = WEAPON_USP;
	SET_MODEL(ENT(pev), "models/w_usp.mdl");

	silencer = 1;

	m_iDefaultAmmo = 12;

	FallInit();// get ready to fall down.
}


void CUSP::Precache( void )
{
	PRECACHE_MODEL("models/v_usp.mdl");
	PRECACHE_MODEL("models/w_usp.mdl");
	PRECACHE_MODEL("models/p_usp.mdl");

	m_iShell = PRECACHE_MODEL ("models/shell.mdl");// brass shell

	PRECACHE_SOUND("items/9mmclip1.wav");
	PRECACHE_SOUND("items/9mmclip2.wav");

	PRECACHE_SOUND ("weapons/usp1.wav");//silenced handgun
	PRECACHE_SOUND ("weapons/usp2.wav");//silenced handgun
	PRECACHE_SOUND ("weapons/usp_unsil-1.wav");//handgun
	PRECACHE_SOUND ("weapons/usp_silencer_off.wav");
	PRECACHE_SOUND ("weapons/usp_silencer_on.wav");


	m_usFireUSP1 = PRECACHE_EVENT( 1, "events/usp1.sc" );
	m_usFireUSP2 = PRECACHE_EVENT( 1, "events/usp2.sc" );
}

int CUSP::GetItemInfo(ItemInfo *p)
{
	p->pszName = STRING(pev->classname);
	p->pszAmmo1 = "9mm";
	p->iMaxAmmo1 = 240;
	p->pszAmmo2 = NULL;
	p->iMaxAmmo2 = -1;
	p->iMaxClip = 12;
	p->iSlot = 1;
	p->iPosition = 2;
	p->iFlags = 0;
	p->iId = m_iId = WEAPON_USP;
	p->iWeight = GLOCK_WEIGHT;

	return 1;
}

BOOL CUSP::Deploy( )
{
	if ( silencer == 1 )
	{
		return DefaultDeploy( "models/v_usp.mdl", "models/p_usp.mdl", USP_DRAW, "onehanded", /*UseDecrement() ? 1 : 0*/ 0 );
	}
	else
	{
		return DefaultDeploy( "models/v_usp.mdl", "models/p_usp.mdl", USP_DRAW_U, "onehanded", /*UseDecrement() ? 1 : 0*/ 0 );
	}

}

void CUSP::SecondaryAttack( void )
{
	if ( silencer == 1 )
	{
		SendWeaponAnim( USP_DETACH_SILENCER );
		silencer = 0;
	}
	else
	{
		SendWeaponAnim( USP_ADD_SILENCER );
		silencer = 1;
	}
	m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 3.8;
	m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 3.8;
	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.8;// idle pretty soon after shooting.
}

void CUSP::PrimaryAttack( void )
{
	GlockFire( 0.01, 0.5, TRUE );
}

void CUSP::GlockFire( float flSpread , float flCycleTime, BOOL fUseAutoAim )
{
	if (m_iClip <= 0)
	{
		if (m_fFireOnEmpty)
		{
			PlayEmptySound();
			m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2;
		}

		return;
	}

	m_iClip--;

	m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH;

	int flags;

#if defined( CLIENT_WEAPONS )
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	// player "shoot" animation
	m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

	// silenced
	if (silencer == 1)
	{
		m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME;
		m_pPlayer->m_iWeaponFlash = DIM_GUN_FLASH;
	}
	else
	{
		// non-silenced
		m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
		m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;
	}

	Vector vecSrc	 = m_pPlayer->GetGunPosition( );
	Vector vecAiming;
	
	if ( fUseAutoAim )
	{
		vecAiming = m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );
	}
	else
	{
		vecAiming = gpGlobals->v_forward;
	}

	Vector vecDir;
	if ( silencer == 1 )
	{
		vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, VECTOR_CONE_2DEGREES, 8192, BULLET_PLAYER_9MM, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
	}
	else
	{
		vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, VECTOR_CONE_4DEGREES, 8192, BULLET_PLAYER_9MM, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
	}
	
	if ( silencer == 1 )
	{
		PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), fUseAutoAim ? m_usFireUSP1 : m_usFireUSP1, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, ( m_iClip == 0 ) ? 1 : 0, 0 );
	}
	else
	{
		PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), fUseAutoAim ? m_usFireUSP2 : m_usFireUSP2, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, ( m_iClip == 0 ) ? 1 : 0, 0 );
	}
	m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + flCycleTime;

	if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
		// HEV suit - indicate out of ammo condition
		m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);

	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}


void CUSP::Reload( void )
{
	if ( m_pPlayer->ammo_9mm <= 0 )
		return;
	
	if (silencer == 1)
	{
		DefaultReload( 12, USP_RELOAD, 1.5 );
	}
	else
	{
		DefaultReload( 12, USP_RELOAD_U, 1.5 );
	}
}


void CUSP::WeaponIdle( void )
{
	ResetEmptySound( );

	m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );

	if ( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() )
		return;

	// only idle if the slid isn't back
	if (m_iClip != 0)
	{
		int iAnim;
		float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 );

		if (silencer == 1)
		{
			iAnim = USP_IDLE1;
			m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0 / 16;
		}
		else
		{
			iAnim = USP_IDLE1_U;
			m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0;
		}
		SendWeaponAnim( iAnim, 1 );
	}
}








class CUSPAmmo : public CBasePlayerAmmo
{
	void Spawn( void )
	{ 
		Precache( );
		SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
		CBasePlayerAmmo::Spawn( );
	}
	void Precache( void )
	{
		PRECACHE_MODEL ("models/w_9mmclip.mdl");
		PRECACHE_SOUND("items/9mmclip1.wav");
	}
	BOOL AddAmmo( CBaseEntity *pOther ) 
	{ 
		if (pOther->GiveAmmo( 12, "9mm", 240 ) != -1)
		{
			EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/9mmclip1.wav", 1, ATTN_NORM);
			return TRUE;
		}
		return FALSE;
	}
};
LINK_ENTITY_TO_CLASS( ammo_uspclip, CUSPAmmo );
















Note: Im using 9mm instead of 45 so if u want to change it you will have to do it by yourself
Now go to weapons.h and add this:




class CUSP : public CBasePlayerWeapon
{
public:
	void Spawn( void );
	void Precache( void );
	int iItemSlot( void ) { return 2; }
	int GetItemInfo(ItemInfo *p);

	void PrimaryAttack( void );
	void SecondaryAttack( void );
	void GlockFire( float flSpread, float flCycleTime, BOOL fUseAutoAim );
	BOOL Deploy( void );
	void Reload( void );
	void WeaponIdle( void );
	int silencer;

	virtual BOOL UseDecrement( void )
	{ 
#if defined( CLIENT_WEAPONS )
		return TRUE;
#else
		return FALSE;
#endif
	}

private:
	int m_iShell;
	

	unsigned short m_usFireUSP1;
	unsigned short m_usFireUSP2;
};
Now the rest just follow badsniper365 weapon tutorial.
If you have any questions, ask me in the comment section.
IRON SIGHT EXTRA: CREATE YOUR OWN IRON SIGHT

IRON SIGHT EXTRA: CREATE YOUR OWN IRON SIGHT

Weapons Modelling Tutorial 3 comments

Read the summary of Server Side Coding. PLACEHOLDER

IRON SIGHT PART 2: CLIENT SIDE

IRON SIGHT PART 2: CLIENT SIDE

Client Side Coding Tutorial

Just read the summary of server side coding. PLACEHOLDER TEXT

IRON SIGHT PART 1: SERVER SIDE

IRON SIGHT PART 1: SERVER SIDE

Server Side Coding Tutorial

I was about to publish this article before but my FUCKING BROWSER JUST FUCKING CLOSED... so i will do this all over again. Iron sight for Python.

Adding New Skill Healths

Adding New Skill Healths

Server Side Coding Tutorial

In this tutorial we will learn how to add new Skill Health links to add to new custom monsters.

Add file RSS Files
Half-Life Modding Kit 3.0 Programs Only

Half-Life Modding Kit 3.0 Programs Only

Full Version 1 comment

This version of the Modding Kit only contains the programs inside of the modding kit.

Half-Life Modding Kit 3.0 Coding Only

Half-Life Modding Kit 3.0 Coding Only

Source Code 2 comments

Just for the people who are only interested in the coding aspect of Half-Life Modding Kit. This version includes only the Official Half-Life SDK's including...

Half-Life Modding Kit 3.0 Mapping Only

Half-Life Modding Kit 3.0 Mapping Only

Mapping Tool

Not everyone wants all the other tools in Half-Life Modding Kit 3.0. This version only contains the tools used for mapping such as Hammer Editor and compile...

Half-Life Modding Kit 3.0 Complete

Half-Life Modding Kit 3.0 Complete

Full Version 8 comments

Its been over a year since the last update and I wanted to release an update so that people know that the Half-Life Modding Kit is still being updated...

Half-Life Modding Kit 2.2 Installer

Half-Life Modding Kit 2.2 Installer

Full Version 3 comments

Half-life Modding Kit 2.2 is ready are you? Though it does not look like I have put to much into this update I have, I spent a lot of time looking for...

Half-Life Modding Kit 2.2 Archive

Half-Life Modding Kit 2.2 Archive

Full Version 1 comment

Half-life Modding Kit 2.2 is ready are you? Though it does not look like I have put to much into this update I have, I spent a lot of time looking for...

Comments  (0 - 10 of 77)
cd5ssmffan
cd5ssmffan

I may be missing something but how do you compile the mod properly?

filecopy contains this:

p4 edit %~f2
copy %1 %~f2

this doesn't actually do anything

Reply Good karma Bad karma+1 vote
employee426
employee426

I would like to get into modding and have literally no experience unless you count loving half life and all the mods around it experience. Would this be the right way to get into it?

Reply Good karma Bad karma+2 votes
badsniper365 Creator
badsniper365

I think it’s a good way to get started and that’s why I made it. I started out the same way loving half life but no clue how to mod, what I would do is start with basic map making first and work your way to better mapping and possibly coding, modeling and other modifications

Reply Good karma+2 votes
Crestfall2nd
Crestfall2nd

I accidentally double posted.

Reply Good karma Bad karma+1 vote
Crestfall2nd
Crestfall2nd

h t t p s : / / g a m e b a n a n a . c o m / t o o l s / 6 2 3 6

Reply Good karma Bad karma+1 vote
Inepticus
Inepticus

There seems to be a problem with loading the Client.dll

Reply Good karma Bad karma+1 vote
badsniper365 Creator
badsniper365

Which client.dll?

Reply Good karma+1 vote
Inepticus
Inepticus

The client.dll that comews with the "mod" folder. When I try to launch the mod it crashes and says that it could not load library and it points towards the cl_dlls\client.dll directory.

Reply Good karma Bad karma+1 vote
badsniper365 Creator
badsniper365

It is possible that the client.dll got corrupted at some point in time. The dlls in the modding kit are just default valve dlls, just go to your halflife/valve folder and copy the client, I would also copy a new server dll (hl.dll)

Reply Good karma+1 vote
Inepticus
Inepticus

Alright, the default dll's work, I just thought this was a modified dll or something.
Also on your previous comment on adding opposing force weapons, there's really no need to go trough the hassle, I mostly wanted the npc's but that would be too much trouble to code when they're already done in the original dll's.
Plus I can live with the night vision, I was just curious when I asked about the flashlight.

Anyways thank you so much for the help :) <3

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Report Profile
Icon
Half-Life
Game
Half-Life
Creator
Contact
Send Message
Release date
Mod watch
Follow
Share
Community Rating

Average

9.6

12 votes submitted.

You Say

-

Ratings closed.

Highest Rated (2 agree) 10/10

Great Idea for helping the kids!

Jun 4 2016 by G.P.A

Embed Buttons
Link to Half Life Modding Kit by selecting a button and using the embed code provided more...
Half Life Modding Kit
Statistics
Last Update
Watchers
73 members
Addons
2
Files
22
Articles
13
Reviews
10