09.01.2014, 20:40
Basically, my script doesn't register the upkey correctly, I believe.
I can press ALT (KEY_WALK) for it to output 2 (debug) and if I press ALT (KEY_WALK) + Space (KEY_SPRINT) it outputs 1, why? It's supposed to output 1 when pressing Space + W.
The last KEY_UP doesn't work either.
pawn Код:
if(!IsPlayerNPC(playerid) && PlayerLogged[playerid])
{
if(!IsPlayerInAnyVehicle(playerid))
{
new
keys, ud, lr;
GetPlayerKeys(playerid, keys, ud, lr);
if((keys & KEY_SPRINT) && (keys & KEY_UP))
{
SendClientMessage(playerid, COLOR_LIGHTGREY, "1");
Noise[playerid] = 4;
}
else if(keys & KEY_WALK)
{
SendClientMessage(playerid, COLOR_LIGHTGREY, "2");
Noise[playerid] = 1;
}
else if(keys & KEY_UP)
{
SendClientMessage(playerid, COLOR_LIGHTGREY, "3");
Noise[playerid] = 2;
}
else Noise[playerid] = 0;
} else Noise[playerid] = 5;
switch(Noise[playerid])
{
case 0: PlayerTextDrawSetString(playerid, StatsTextdraw2[playerid], "noise: none");
case 1: PlayerTextDrawSetString(playerid, StatsTextdraw2[playerid], "noise: quiet");
case 2: PlayerTextDrawSetString(playerid, StatsTextdraw2[playerid], "noise: noticable");
case 3: PlayerTextDrawSetString(playerid, StatsTextdraw2[playerid], "noise: moderate");
case 4: PlayerTextDrawSetString(playerid, StatsTextdraw2[playerid], "noise: loud");
case 5: PlayerTextDrawSetString(playerid, StatsTextdraw2[playerid], "noise: very loud");
}
}
The last KEY_UP doesn't work either.