Timers not working properly
#1

Everything that contains timer on my server is not working properly. It works well for the first player. Then everything gets doubled for the second and triple for the third.

A health timer from my server:

PHP код:
new healthtimer[MAX_PLAYERS]; 
PHP код:
public OnPlayerConnect(playerid)
{
    
healthtimer[playerid] = SetTimerEx("DecreaseHealth"300001"i"playerid);
    return 
1;

PHP код:
public DecreaseHealth(playerid// Decreases player health by 1
{
    new 
Float:health;
    
GetPlayerHealth(playeridhealth);
    
SetPlayerHealth(playeridhealth 1.0);
    return 
1;

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    
KillTimer(healthtimer[playerid]);
    
SaveAccount(playerid);
    return 
1;

This should decrease 1 HP after every 30 seconds. But when the second player joins, his health decreases at double speed and triple for the third. I have fuel system and payday system which are written the same way and giving same problem.
Reply


Messages In This Thread
Timers not working properly - by JaskaranSingh - 19.04.2018, 19:43
Re: Timers not working properly - by AlamoTR - 19.04.2018, 19:51
Re: Timers not working properly - by JaskaranSingh - 19.04.2018, 19:53
Re: Timers not working properly - by Hunud - 19.04.2018, 20:00
Re: Timers not working properly - by JaskaranSingh - 19.04.2018, 20:03
Re: Timers not working properly - by UFF - 20.04.2018, 03:25
Re: Timers not working properly - by GTLS - 20.04.2018, 07:34

Forum Jump:


Users browsing this thread: 2 Guest(s)