13.02.2015, 23:05
(
Последний раз редактировалось Aerotactics; 14.02.2015 в 00:26.
)
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
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]);
}
}
}