Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

changing a players movement and speed with a function.

| Inside3d Forums Forum Index -> QuakeC Programming

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 |

Display posts from previous:

| Inside3d Forums Forum Index -> QuakeC Programming | All times are GMT
Page 1 of 1

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group