Welcome, Guest! Login | Register

Adding Simple Pick up in Multiplayer [Print this Article]
Posted by: LunarWolfX
Date posted: Jul 17 2005
User Rating: 4.3 out of 5.0
Number of views: 3473
Number of comments: 5
Description: allows players to pick up objects with +use in multiplayer.
I'm not sure if this works for the sdk from scratch, but it works for the hl2dm sdk.

Open up hl2mp_player.cpp inside the server code(hl.dll).

Scroll down until you find this:

 CODE (C++) 
void CHL2MP_Player::PickupObject( CBaseEntity *pObject, bool bLimitMassAndSize )
{
}


Turn that into this:

 CODE (C++) 
void CHL2MP_Player::PickupObject( CBaseEntity *pObject, bool bLimitMassAndSize )
{
    BaseClass::PickupObject(pObject,bLimitMassAndSize);
   
}

Rate This Article
This article is currently rated: 4.3 out of 5.0 (3 Votes)

You have to register to rate this article.
Related Files
Zip FileFilename: rp_cityx_0070067.jpg
File Size: 115.7 KB

User Comments Showing comments 1-5

Posted By: ts2do on Jul 22 2005 at 23:15:03
it's server.dll


also...
this would be just as good:
void CHL2MP_Player::PickupObject( CBaseEntity *pObject, bool bLimitMassAndSize )
{
BaseClass::PickupObject(pObject,bLimitMassAndSize);
}Edited by ts2do on Jul 22 2005, 23:17:04

Posted By: rapsfann on Jul 30 2005 at 10:31:34
Awsome man thanks a lot. My mod depends on being able to do this. How difficult would it be to use a weapon while carrying objects?

Posted By: Feldor on Aug 10 2005 at 19:20:11
Mabye figure out a way to throw the picked up object, not as far as a gravity gun would but similar?

Posted By: RaccoonKing on Aug 30 2005 at 16:23:12
Cool. I noticed that if you're holding a gun, and then pick up any form of ammo, and then fire, the game crashes (I think from an unreferenced point in memory)

Any idea how to solve this?

Posted By: nisan on Oct 20 2005 at 11:18:33
I've been working on this a while. (I'm a noob to the entire HL coding scene)

It's alot more than just doing this, I've found if I press throw when holding something, it fires the gun I had out before I picked it up, but uses up no ammo.

There is ALOT of pickup code in the HL2SP files that aren't in the HL2MP files, I'm currently going through it all trying to put it back...But lately I've managed to fubar the code, so that it won't pick stuff up at all any more :(


You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 04 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005


Latest Comments
Where do we go from here
General | News
By: MIFUNE | Jun 09 2008
 
The Input/Output system
Half-Life 2 | Level Design
By: nazitaco | Dec 23 2007
 
Where do we go from here
General | News
By: Rob_F | Nov 22 2007
 
Rescaling Half-Life
Half-Life | Coding | Shared Tutorials
By: christoph | Nov 12 2007
 
GameUI
Half-Life 2 | Coding | Client Side Tutorials
By: Evil_j | Oct 29 2007
 
3 State Zoom For Any Weapon
Half-Life 2 | Coding | Server Side Tutorials
By: Ennuified | Oct 18 2007
 
Storing weapons on ladder
Half-Life 2 | Coding | Snippets
By: cct | Sep 07 2007
 
CTF Gameplay Part 1
Half-Life | Coding | Shared Tutorials
By: DarkNight | Aug 28 2007
 
CTF Gameplay Part 1
Half-Life | Coding | Shared Tutorials
By: deedok | Aug 20 2007
 
Debugging your half-life 2 mod
Half-Life 2 | Coding | Articles
By: blackshark | Aug 17 2007
 

Site Info
296 Approved Articless
5 Pending Articles
3940 Registered Members
0 People Online (12 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!