CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
isSprinting() + How To Get Your Speed
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="God" data-source="post: 16246" data-attributes="member: 19"><p style="text-align: center"><span style="font-family: 'Verdana'"><span style="font-size: 22px"><span style="color: #0080ff"><strong>Hello CCM <span style="font-size: 22px"><img src="/styles/default/xenforo/smilies.emoji/people/kissing_heart.emoji.svg" class="smilie" loading="lazy" alt=":kissingheart:" title="Kissing Heart :kissingheart:" data-shortname=":kissingheart:" /></span></strong></span></span></span></p> <p style="text-align: center">So just a few minutes ago i needed a check to see if i'm sprinting and I couldn't find one, so I wrote one real quick. If there is a function like this already inside the gsc... well... you can learn something from this lol</p> <p style="text-align: center"></p> <p style="text-align: center">Anyway, here it is</p><p>[PHP]isSprinting()</p><p>{</p><p> MyVelocity[2] = self GetVelocity(); //since GetVelocity() stores 3 values we have to also</p><p> </p><p> if(MyVelocity[0] > 220 || MyVelocity[0] < -220) //getting the first value (our foward value)</p><p> return true; //true if we are sprinting</p><p> else</p><p> return false;</p><p>}</p><p></p><p>myVelo() //You can use this if you want to find your own values, the above worked for me</p><p>{</p><p> self endon("Velo");</p><p> for(;;)</p><p> {</p><p> self iprintln(self GetVelocity());</p><p> wait 1; //Lower this if you want to be more accurate</p><p> }</p><p>}</p><p></p><p>//or you can use something like this if you want to use HUDs instead of iPrintln (didn't test)</p><p>DrawMyVelocity(text, font, fontScale, align, relative, x, y, color, alpha, glowColor, glowAlpha, sort)</p><p>{</p><p></p><p> hud = self createFontString(font, fontScale);</p><p> hud setPoint(align, relative, x, y);</p><p> hud.color = color;</p><p> hud.alpha = alpha;</p><p> hud.glowColor = glowColor;</p><p> hud.glowAlpha = glowAlpha;</p><p> hud.sort = sort;</p><p> hud.alpha = alpha;</p><p> hud setSafeText(self GetVelocity());</p><p> hud.foreground = true;</p><p> hud.hideWhenInMenu = true;</p><p> hud.archived = false;</p><p> return hud;</p><p>}[/PHP]</p></blockquote><p></p>
[QUOTE="God, post: 16246, member: 19"] [CENTER][FONT=Verdana][SIZE=6][COLOR=#0080ff][B]Hello CCM [SIZE=6]:kissingheart:[/SIZE][/B][/COLOR][/SIZE][/FONT] So just a few minutes ago i needed a check to see if i'm sprinting and I couldn't find one, so I wrote one real quick. If there is a function like this already inside the gsc... well... you can learn something from this lol Anyway, here it is[/CENTER] [PHP]isSprinting() { MyVelocity[2] = self GetVelocity(); //since GetVelocity() stores 3 values we have to also if(MyVelocity[0] > 220 || MyVelocity[0] < -220) //getting the first value (our foward value) return true; //true if we are sprinting else return false; } myVelo() //You can use this if you want to find your own values, the above worked for me { self endon("Velo"); for(;;) { self iprintln(self GetVelocity()); wait 1; //Lower this if you want to be more accurate } } //or you can use something like this if you want to use HUDs instead of iPrintln (didn't test) DrawMyVelocity(text, font, fontScale, align, relative, x, y, color, alpha, glowColor, glowAlpha, sort) { hud = self createFontString(font, fontScale); hud setPoint(align, relative, x, y); hud.color = color; hud.alpha = alpha; hud.glowColor = glowColor; hud.glowAlpha = glowAlpha; hud.sort = sort; hud.alpha = alpha; hud setSafeText(self GetVelocity()); hud.foreground = true; hud.hideWhenInMenu = true; hud.archived = false; return hud; }[/PHP] [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
isSprinting() + How To Get Your Speed
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top