changing a players movement and speed with a function.
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
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)
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)
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
- Code: Select all
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: Select all
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!
-

MauveBib - Posts: 634
- Joined: Thu Nov 04, 2004 1:22 am
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest