I need Press C to Enter REP+ for HELP
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
No, you're missing the point! You are confusing what "GetPlayerKeys" returns with what a player presses on their keyboard.

If I press "J", what does it do? You don't know and you can't detect it. However, if I press my "jump" key (which may or may not be "J") you CAN detect that. You can only see the EFFECTS of what the player told the game to do, not how they told the game to do it. Yes, crouch is "C" BY DEFAULT, but you can't assume it always will be. If someone has remapped their crouch key to "shift" and you say "press C to enter", then your code will fail - they will do as they are told, press C, and nothing will happen! Then they'll come and report a bug. What you should say is either "~k~~PED_DUCK~" or just "crouch". The first will look up what key THEY have mapped to crouch and report that, the second will just tell them to press whatever key they have duck mapped to (which they should know).

This is why I said you can't have your "enter" function bound to "C", because there is NO WAY to detect when a user presses "C", because there is NO WAY to know which keys do what.
I mean about all buttons are able to use IG, not a random button as u see in GetPlayerKey.
Try this one and see that is teleporting you as ever you will try that will works.
Place a positions and see.
Try with, KEY_FIRE, KEY_JUMP, KEY_YES, KEY_NO, All of them will works !
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_CROUCH)
    {
            if(IsPlayerInSphere(playerid,0.0 ,0.0 , 0.0 ,1))//Change the positions
            {
                SetPlayerPos(playerid,0.0 ,0.0 , 0.0);//Player telepotring
                return 1;
            }
    }
    return 1;
}
EDIT:
Quote:
Originally Posted by PrawkC
Посмотреть сообщение
What you don't understand that if someone changes their default crouch key to say, SHIFT, or B then C will no longer work for entering things, it will become SHIFT or B.
But i really dont care about pepole will change thier buttons, i have explained him how to set it and that will works when he will click " C " if his buttons are restarted without changed.
Reply


Messages In This Thread
I need Press C to Enter REP+ for HELP - by manishmulchandani11 - 10.10.2012, 17:27
Re: I need Press C to Enter REP+ for HELP - by BlueGames - 10.10.2012, 17:32
Re: I need Press C to Enter REP+ for HELP - by BlueGames - 10.10.2012, 17:52
Re: I need Press C to Enter REP+ for HELP - by BlueGames - 10.10.2012, 17:58
Re: I need Press C to Enter REP+ for HELP - by BlueGames - 10.10.2012, 18:52
Re: I need Press C to Enter REP+ for HELP - by Skillet` - 10.10.2012, 18:59
Re: I need Press C to Enter REP+ for HELP - by PrawkC - 10.10.2012, 19:00
Re: I need Press C to Enter REP+ for HELP - by BlueGames - 10.10.2012, 19:03
Re: I need Press C to Enter REP+ for HELP - by Skillet` - 10.10.2012, 19:09
Re: I need Press C to Enter REP+ for HELP - by BlueGames - 10.10.2012, 19:13

Forum Jump:


Users browsing this thread: 4 Guest(s)