Forum rules
- Ask questions about or share code from languages other than Source Engine scripting.
- Start new topic titles with the code language in brackets (i.e. [C#], [C++], [PHP], etc.)
JoshN0S
Former Server Admin
Posts: 504 Joined: Mon May 17, 2010 10:01 pm
Location: United States
Post
by JoshN0S » Fri May 20, 2011 8:37 pm
Code: Select all
void CHL2_Player::PlayerRunCommand(CUserCmd *ucmd, IMoveHelper *moveHelper)
{
// Handle FL_FROZEN.
if ( m_afPhysicsFlags & PFLAG_ONBARNACLE )
{
ucmd->forwardmove = 0;
ucmd->sidemove = 0;
ucmd->upmove = 0;
ucmd->buttons &= ~IN_USE;
}
// Can't use stuff while dead
if ( IsDead() )
{
ucmd->buttons &= ~IN_USE;
}
//Update our movement information
if ( ( ucmd->forwardmove != 0 ) || ( ucmd->sidemove != 0 ) || ( ucmd->upmove != 0 ) )
{
m_flIdleTime -= TICK_INTERVAL * 2.0f;
if ( m_flIdleTime < 0.0f )
{
m_flIdleTime = 0.0f;
}
m_flMoveTime += TICK_INTERVAL;
if ( m_flMoveTime > 4.0f )
{
m_flMoveTime = 4.0f;
}
}
else
{
m_flIdleTime += TICK_INTERVAL;
if ( m_flIdleTime > 4.0f )
{
m_flIdleTime = 4.0f;
}
m_flMoveTime -= TICK_INTERVAL * 2.0f;
if ( m_flMoveTime < 0.0f )
{
m_flMoveTime = 0.0f;
}
}
//Msg("Player time: [ACTIVE: %f]\t[IDLE: %f]\n", m_flMoveTime, m_flIdleTime );
BaseClass::PlayerRunCommand( ucmd, moveHelper );
}
killman2639
Former Server Admin
Posts: 292 Joined: Mon Aug 23, 2010 8:41 pm
Post
by killman2639 » Tue Jul 19, 2011 7:51 pm
Since HL2DM uses Source Engine and Source was coded in C++, this thread name should be Player Run Command [C++]
Hi, I'm Reloaded. :)
Code: Select all
[GR|CMX] Reelawded | Reloaded : hi, im black
[GR|CMX] Reelawded | Reloaded : shit
Disconnect: being black.
Disconnect: being black.
Nicdel
Server Admin
Posts: 2417 Joined: Sun Apr 11, 2010 4:50 am
Post
by Nicdel » Wed Jul 20, 2011 2:08 am
Joshua wrote: Code: Select all
void CHL2_Player::PlayerRunCommand(CUserCmd *ucmd, IMoveHelper *moveHelper)
{
// Handle FL_FROZEN.
if ( m_afPhysicsFlags & PFLAG_ONBARNACLE )
{
ucmd->forwardmove = 0;
ucmd->sidemove = 0;
ucmd->upmove = 0;
ucmd->buttons &= ~IN_USE;
}
// Can't use stuff while dead
if ( IsDead() )
{
ucmd->buttons &= ~IN_USE;
}
//Update our movement information
if ( ( ucmd->forwardmove != 0 ) || ( ucmd->sidemove != 0 ) || ( ucmd->upmove != 0 ) )
{
m_flIdleTime -= TICK_INTERVAL * 2.0f;
if ( m_flIdleTime < 0.0f )
{
m_flIdleTime = 0.0f;
}
m_flMoveTime += TICK_INTERVAL;
if ( m_flMoveTime > 4.0f )
{
m_flMoveTime = 4.0f;
}
}
else
{
m_flIdleTime += TICK_INTERVAL;
if ( m_flIdleTime > 4.0f )
{
m_flIdleTime = 4.0f;
}
m_flMoveTime -= TICK_INTERVAL * 2.0f;
if ( m_flMoveTime < 0.0f )
{
m_flMoveTime = 0.0f;
}
}
//Msg("Player time: [ACTIVE: %f]\t[IDLE: %f]\n", m_flMoveTime, m_flIdleTime );
BaseClass::PlayerRunCommand( ucmd, moveHelper );
}
Whats the sense of this? Looks like you just copied it from the source file.
Ingame: -[SaD]- Nico
Blake
500+ Posts
Posts: 588 Joined: Mon Jul 05, 2010 8:51 pm
Location: Ontario, Canada
Post
by Blake » Wed Jul 20, 2011 3:48 pm
Nicdel wrote: Whats the sense of this? Looks like you just copied it from the source file.
Same thing i was thinking... on another post he made.
http://www.area51cheatserver.com/forums ... =28&t=1671
Unkown wrote:
Life’s too short to worry about the little things.
Albert Einstein wrote:
You do not really understand something unless you can explain it to your grandmother.