Scripts / [SOLVED] detect player running.

Author
Message
PCS
7
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 28th Sep 2018 19:37
hi all .
i try to detect if player is running when he is pressing the w key and shift key.
i have this , but it does not work


Please help.

Thank you

Pcs
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

The author of this post has marked a post as an answer.

Go to answer
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Sep 2018 22:37
GetScanCode() is going to return a single value so that code can never work!

Use this instead:

Been there, done that, got all the T-Shirts!
PM
PCS
7
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 28th Sep 2018 23:20
thanks AmenMoses I will try it.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
PCS
7
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 28th Sep 2018 23:27
AmenMoses , ok , one more Question how can i reduce the player speed when player gets tired while he is running with a script . what would the function be.
I tried this but with no success : SetGamePlayerControlSpeed(10)

Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 28th Sep 2018 23:42
SetGamePlayerControlTopspeed( value ) is the one you need to use.

This caps the maximum speed the player can go.
Been there, done that, got all the T-Shirts!
PM
PCS
7
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 29th Sep 2018 00:02
ok cool, thanks a lot.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
PCS
7
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 29th Sep 2018 01:18 Edited at: 29th Sep 2018 01:32
if g_KeyPressW == 1 and g_KeyPressSHIFT == 1 then ,,,,,,,, it works perfectly.
but the : SetGamePlayerControlTopspeed( value ) i do not get it to work properly.
Here is only the part of my script im using for the stamina.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 29th Sep 2018 08:19
This post has been marked by the post author as the answer.
See attached script.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
PCS
7
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 29th Sep 2018 08:31
AmenMoses, your a star. it works like a charm.
Thank you my friend.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Login to post a reply

Server time is: 2024-04-25 18:22:39
Your offset time is: 2024-04-25 18:22:39