How to ..
#1

How can I detect if player has pressed key space ?
Reply
#2

Well, direct key detection is impossible with the standard PAWN functions, but you can detect the function that the player usually uses for the space key: The sprint function.

So I guess you'd be using it like this:

pawn Код:
new keys[3];
GetPlayerKeys(playerid, keys[0], keys[1], keys[2]); //keys[0] contains the "other" key values, keys[1] contains the left & right value, and keys[2] contains the up & down value.
if(keys[0] & KEY_SPRINT)//If the player presses the sprint key, usually spacebar
{
  //Do stuff
}
Reply
#3

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
if(keys[0] & KEY_SPRINT)//If the player presses the sprint key, usually spacebar
disagree, lots of people have jump for spacebar not sprint.
Reply
#4

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
disagree, lots of people have jump for spacebar not sprint.
I use left shift to jump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)