Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] Detect Holding Key

 
  • 0 Vote(s) - 0 Average
Pawn Detect Holding Key
GeorgeXCarl
Offline

Burgershot Member
Posts: 11
Threads: 6
Joined: Sep 2020
Reputation: 0
Location: Mars
#1
2021-06-23, 11:07 AM
is there any way how can i check if a player is holding the KEY_SPRINT button?
Kwarde
Offline

Burgershot Member
Posts: 99
Threads: 2
Joined: Sep 2020
Reputation: 8
Location: The Netherlands
#2
2021-06-23, 11:24 AM
https://open.mp/en/docs/scripting/callbacks/OnPlayerKeyStateChange
Look for "Detecting holding a key"
GeorgeXCarl
Offline

Burgershot Member
Posts: 11
Threads: 6
Joined: Sep 2020
Reputation: 0
Location: Mars
#3
2021-06-23, 11:47 AM
is there any other way? because i'm not using OnPlayerKeyStateChange on holding key function
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#4
2021-06-23, 05:57 PM
(2021-06-23, 11:47 AM)GeorgeXCarl Wrote: is there any other way? because i'm not using OnPlayerKeyStateChange on holding key function
https://open.mp/docs/scripting/functions/GetPlayerKeys
Using Pawn.CMD?
If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
Awide
Offline

Burgershot Member
Posts: 62
Threads: 5
Joined: Sep 2019
Reputation: 5
#5
2021-06-23, 09:57 PM
(2021-06-23, 11:47 AM)GeorgeXCarl Wrote: is there any other way? because i'm not using OnPlayerKeyStateChange on holding key function

You could either use that or do GetPlayerKeys.
https://open.mp/docs/scripting/functions/GetPlayerKeys
Desolation Roleplay has closed. You can download the gamemode here: https://www.burgershot.gg/showthread.php?tid=2272
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#6
2021-06-24, 11:06 AM
(2021-06-23, 09:57 PM)Awide Wrote:
(2021-06-23, 11:47 AM)GeorgeXCarl Wrote: is there any other way? because i'm not using OnPlayerKeyStateChange on holding key function

You could either use that or do GetPlayerKeys.
https://open.mp/docs/scripting/functions/GetPlayerKeys
And what's the point of writing the exact same thing I did? :)
Using Pawn.CMD?
If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode