SA-MP Forums Archive
[HELP] How to make keys work when dead. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] How to make keys work when dead. (/showthread.php?tid=96031)



[HELP] How to make keys work when dead. - Yoyoyo - 06.09.2009

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 >>


Re: [HELP] How to make keys work when dead. - _Vortex - 06.09.2009

I have no clue what you mean. Please explain more.


Re: [HELP] How to make keys work when dead. - Correlli - 06.09.2009

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.


Re: [HELP] How to make keys work when dead. - Yoyoyo - 06.09.2009

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.



Re: [HELP] How to make keys work when dead. - Correlli - 06.09.2009

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


Re: [HELP] How to make keys work when dead. - Yoyoyo - 06.09.2009

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



Re: [HELP] How to make keys work when dead. - Correlli - 06.09.2009

I suppose not.


Re: [HELP] How to make keys work when dead. - Yoyoyo - 06.09.2009

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


Re: [HELP] How to make keys work when dead. - Correlli - 06.09.2009

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.