Elvileg lehetséges mikor lenyomod a gombot akkor newkeys értéket kell figyelni mikor elengeded a gombot akkor meg a oldkeys.
OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
Próbáld ki:
new
keytime[MAX_PLAYERS];
public
OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_FIRE)
{
keytime[playerid] = GetTickCount();
}
else if(oldkeys == KEY_FIRE)
{
new
str[64];
format(str, sizeof str, \"Pressed time: %dms\", GetTickCount() - keytime[playerid]);
SendClientMessage(playerid, -1, str);
}
return 1;
}