OnPlayerKeyStateChange always called?
#13

Quote:
Originally Posted by NoahAntilles
Посмотреть сообщение
A small problem has appeared, sadly.

The timer is only called for the first player connected to the server (That's what I think)
The automatic fire works perfectly for this player, but other players still have the manual fire rate.
How can I make the timer so that it's called for every player who presses the button?
Example:
Код:
#define PRESSED(%0) \
		(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0) \
		(((oldkeys & (%0)) == (%0)) && ((newkeys & (%0)) != (%0)))

if(PRESSED(KEY_SPRINT))
{
	if(missileTimer[playerid] != -1) return 1;
	missileTimer[playerid] = SetTimerEx("MissileFunction", 1000, true, "d", playerid);
}
if(RELEASED(KEY_SPRINT)) {
	if(missileTimer[playerid] != -1) {
		KillTimer(missileTimer[playerid]);
		missileTimer[playerid] = -1;
	}
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)