[HELP] How to make keys work when dead.
#1

Well all you people that said it works when dead, it doesnt ^^
I tested it.

Does anyone know how to make it so you can press a key and It will work the same as when alive.

I cant use OnPlayerKeyStateChange when the player is not spawned. Nothing will happen. Although, when spawned it works.
I want to know if there is anyway to make a key or if there are any keys that will work when the player is dead; changing classes.

I really dont want to resort making this into a command >>
Reply
#2

I have no clue what you mean. Please explain more.
Reply
#3

Which keys are you trying to detect? If you're trying to get keys UP, DOWN, LEFT or RIGHT you can forget it because i think you can't detect those keys if player isn't spawned.
Reply
#4

Like, KEY_FIRE, KEY_SPRINT, etc.


For the guy who doesnt know what I mean:
^ I cant use OnPlayerKeyStateChange when the player is not spawned. Nothing will happen. Although, when spawned it works.
Reply
#5

Well, i have made a quick test:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkeys & KEY_ACTION)
  {
    printf("DEBUG: debugMsg - works?");
  }
  return 1;
}
and it prints "DEBUG: debugMsg - works?" message into the console only when player is spawned (and if he presses the KEY_ACTION key), so i guess you can't detect any key when player is not spawned but i remember that someone (i think ******) talked about YSI that can detect keys but only left and right, but i'm not sure.

Edit: Found it - http://forum.sa-mp.com/index.php?top...2415#msg742415
Reply
#6

So it is not possible to use a key when not spawned?
Reply
#7

I suppose not.
Reply
#8

Quote:
Originally Posted by Don Correlli
****** only made left and right detected. I would really like up and down lol.
Reply
#9

Quote:
Originally Posted by Yoyoyo
Quote:
Originally Posted by Don Correlli
****** only made left and right detected. I would really like up and down lol.
Exactly what i said before..
Quote:
Originally Posted by Don Correlli
and it prints "DEBUG: debugMsg - works?" message into the console only when player is spawned (and if he presses the KEY_ACTION key), so i guess you can't detect any key when player is not spawned but i remember that someone (i think ******) talked about YSI that can detect keys but only left and right, but i'm not sure.
And that is detected by change of class, you can't detect other keys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)