BRB..pausing..
#1

Someone know how to put the text "BRB ... pausing" under the playername when he press ESC?
Reply
#2

There isn't a way to detect when a player presses the ESC key.
Reply
#3

Quote:
Originally Posted by Memoryz
View Post
There isn't a way to detect when a player presses the ESC key.
getplayertickcount

This forum requires that you wait 120 seconds between posts. Please try again in 23 seconds.
OMGWTFBBQ
Reply
#4

mmm..so..what i need to do? :P

1. This forum requires that you wait 120 seconds between posts. Please try again in 74 seconds.
1. This forum requires that you wait 120 seconds between posts. Please try again in 64 seconds.
1. This forum requires that you wait 120 seconds between posts. Please try again in 44 seconds.
1. This forum requires that you wait 120 seconds between posts. Please try again in 21 seconds.
1. This forum requires that you wait 120 seconds between posts. Please try again in 5 seconds.


Anti spam nub.
Reply
#5

i think theres a fs somewhere, but i aint gunna search it cause im doing some scripts myself atm
Reply
#6

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;
}
Reply
#7

mmm k i will try!
Reply
#8

Make sure you check how many times OnPlayerUpdate is called though, 32 is a number I've heard a few people say around the forums.
Reply
#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
#10

Like I said, 32 may not be the amount of times OnPlayerUpdate is called. I've never done it better, all I know is that is how my friend done it. Check how many times OnPlayerUpdate is called and use 1 / number of times it is called in OnPlayerUpdate.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)