GetPlayerKeys not working
#1

This excerpt is in a 100 ms timer (which doesn't cause me any lag so far). The problem is that the key up and key down are unresponsive. The timer also performs a few other loops.

Additional question: Is it more efficient to perform 3 tasks in one timer, or 3 timers for each task? Or is there no difference?

EDIT: It works for arrow keys, not WASD. Noted here as well: https://sampwiki.blast.hk/wiki/GetPlayerKeys

pawn Код:
for(new j=0; j<MAX_PLAYERS; j++)
            {
                new keys, ud, lr;
                GetPlayerKeys(j, keys, ud, lr);
                if(IsPlayerInVehicle(j,i) && GetPlayerState(j) == PLAYER_STATE_DRIVER)
                {
                    if(ud == KEY_UP)
                    {
                        PlayerTextDrawColor(j, Textdraw8[j], 0x00FFFFFF);
                        PlayerTextDrawColor(j, Textdraw9[j], -1061109505);
                        PlayerTextDrawColor(j, Textdraw10[j], -1061109505);
                        PlayerTextDrawHide(j, Textdraw8[j]);
                        PlayerTextDrawShow(j, Textdraw8[j]);
                        PlayerTextDrawHide(j, Textdraw9[j]);
                        PlayerTextDrawShow(j, Textdraw9[j]);
                        PlayerTextDrawHide(j, Textdraw10[j]);
                        PlayerTextDrawShow(j, Textdraw10[j]);
                    }
                    if(ud == KEY_DOWN)
                    {
                        PlayerTextDrawColor(j, Textdraw8[j], -1061109505);
                        PlayerTextDrawColor(j, Textdraw9[j], 0x00FFFFFF);
                        PlayerTextDrawColor(j, Textdraw10[j], -1061109505);
                        PlayerTextDrawHide(j, Textdraw8[j]);
                        PlayerTextDrawShow(j, Textdraw8[j]);
                        PlayerTextDrawHide(j, Textdraw9[j]);
                        PlayerTextDrawShow(j, Textdraw9[j]);
                        PlayerTextDrawHide(j, Textdraw10[j]);
                        PlayerTextDrawShow(j, Textdraw10[j]);
                    }
                }
            }
Reply
#2

Those keys dont detect in a vehicle.
Reply
#3

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Those keys dont detect in a vehicle.
Well, I found out they do, but only the arrow keys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)