06.02.2019, 16:52
Quote:
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? |
Код:
#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; } }