Question
#8

Quote:
Originally Posted by Burridge
Посмотреть сообщение
AFAIK having lots of separate timers that work at the same time (for instance 5 1 second timers running at the same time) can cause some lag (especially with more players). I tend to have a global timer for everything that runs at the same time, then add checks so that it only runs the part of the timer that needs to run per player. (I probably explained that badly, sorry if it makes no sense).

Also IMHO you could make your timer much tidier and still work exactly the same. By using a switch statement.

pawn Код:
forward AntiSpawnkill(playerid);
public AntiSpawnkill(playerid)
{
    switch(DMZone[playerid])
    {
        case 0 .. 4: SetPlayerHealth(playerid,100); // 0 - 4
    }
}
Код:
forward AntiSpawnkill(playerid);
public AntiSpawnkill(playerid)
{
    switch(DMZone[playerid])
    {
        case 0 : SetPlayerHealth(playerid,100); // 0 - 4
        case 1 : SetPlayerHealth(playerid,100); // 0 - 4
.
.
.

    }
}
Like that?
Reply


Messages In This Thread
Question - by MahdiGames - 10.01.2014, 22:52
Re: Question - by Hansrutger - 10.01.2014, 23:01
Re: Question - by MahdiGames - 10.01.2014, 23:04
Re: Question - by NightSpore - 10.01.2014, 23:08
Re: Question - by BlackBank - 10.01.2014, 23:14
Re: Question - by MahdiGames - 11.01.2014, 09:19
Re: Question - by Burridge - 11.01.2014, 09:30
Re: Question - by MahdiGames - 11.01.2014, 10:02
Re: Question - by amirab - 11.01.2014, 10:05
Re: Question - by Burridge - 11.01.2014, 10:12

Forum Jump:


Users browsing this thread: 2 Guest(s)