View previous topic :: View next topic |
Author |
Message |
ceriux

Joined: 06 Sep 2008 Posts: 969 Location: Florida, USA
|
Posted: Mon Feb 02, 2009 6:42 am Post subject: changing a players movement and speed with a function. |
|
|
basically i would like to player to either come to a extream crawl or to a complete stop, till a number meter is above a certain value.
the only thing i dont know how to do is actually change the players movement once self.stamina == 0 and return to normal after its raised above it.
(im using DP, and DPEXTENSIONS.QC with SV_USER.QC) _________________ QuakeDB - Quake ModDB Group |
|
Back to top |
|
 |
MauveBib

Joined: 04 Nov 2004 Posts: 602
|
Posted: Mon Feb 02, 2009 6:59 am Post subject: |
|
|
Code: |
if (self.stamina == 0)
if (vlen(self.velocity > 100))
self.velocity = normalize(self.velocity) * 100;
|
EDIT
On second thoughts, you'll need to retain the velocity_z for falling etc.
Code: |
local float vz;
vz = self.velocity_z;
if (self.stamina == 0)
if (vlen(self.velocity > 100))
self.velocity = normalize(self.velocity) * 100;
self.velocity_z = vz;
|
Or an onground check. Play around, find what works best. _________________ Apathy Now! |
|
Back to top |
|
 |
|