BRB..pausing..
#9

Quote:
Originally Posted by Conroy
View Post
OnPlayerUpdate isn't called.

Find out how many times OnPlayerUpdate is called (32 per second approx.), then create a timer to zero a variable which is increased everytime OnPlayerUpdate is called.

Ex:

pawn Code:
forward CheckForPause();

new PlayerUpdateCount[MAX_PLAYERS];
new PlayerPaused[MAX_PLAYERS];

//OnGameModeInit
SetTimer("CheckForPause", 1000, true);

//OnPlayerUpdate
PlayerUpdateCount[playerid] += 0.03125
//Because 0.03125 * the amount of times OnPlayerUpdate is called (32) equals 1

public CheckForPause()
{
    for(new i; i <= MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) && !PlayerPaused[i]) {
            PlayerUpdateCount[i]--;
            if(PlayerUpdateCount[i] < 0) PlayerPaused[i] = 1;
        }
    }
    return 1;
}
Why this doesn't work for me?
Reply


Messages In This Thread
BRB..pausing.. - by Face9000 - 19.09.2010, 16:17
Re: BRB..pausing.. - by Memoryz - 19.09.2010, 16:20
Re: BRB..pausing.. - by WillyP - 19.09.2010, 16:22
Re: BRB..pausing.. - by Face9000 - 19.09.2010, 16:26
Re: BRB..pausing.. - by WillyP - 19.09.2010, 16:29
Re: BRB..pausing.. - by Conroy - 19.09.2010, 16:39
Re: BRB..pausing.. - by Face9000 - 19.09.2010, 16:42
Re: BRB..pausing.. - by Conroy - 19.09.2010, 16:43
Re: BRB..pausing.. - by The_Moddler - 19.09.2010, 17:33
Re: BRB..pausing.. - by Conroy - 19.09.2010, 17:35

Forum Jump:


Users browsing this thread: 1 Guest(s)