Looking for a pause system
#1

I can't seem to find exactly what I'm looking for though.

What I'm looking for is a way to show a text label on someone who is paused (like "BRB... Pausing").

I want that label to show for a period of seconds and then the player disappears until they unpause.

I found several AFK systems but AFK doesn't necessarily mean PAUSED. I don't want to detect inactivity. I want to detect ESC/PAUSED.

I want the label to show up immediately when the player pauses and then (after about 3-4 seconds) I want the player to become invisible to others until they unpause.
Reply
#2

Count with a timer the times a player doesn't call OnPlayerUpdate. in OPU reset the count variable to zero.
If the variable is higher than an amount you like then you can indicate them as AFK. Use Create3DTextLabel and Attach3DTextLabelToPlayer for the text label thingy. again a check in your timer (if you think the player is AFK about 3-4 minutes set their virtual world to a different one to make them hide from another player). If they return back (OPU gets called directly) then you can change their world back and also remove the text label with Delete3DTextLabel.
Reply
#3

Quote:
Originally Posted by BigETI
Посмотреть сообщение
Count with a timer the times a player doesn't call OnPlayerUpdate. in OPU reset the count variable to zero.
If the variable is higher than an amount you like then you can indicate them as AFK. Use Create3DTextLabel and Attach3DTextLabelToPlayer for the text label thingy. again a check in your timer (if you think the player is AFK about 3-4 minutes set their virtual world to a different one to make them hide from another player). If they return back (OPU gets called directly) then you can change their world back and also remove the text label with Delete3DTextLabel.
I have no idea how to do all that. LOL

Also its not minutes I want. Its seconds.
Reply
#4

My signature.
Reply
#5

Your FS does everything I want as stated above?
Reply
#6

It doesn't make the player dissapear, but it creates a label on a player that is AFK. Also there is a 3D text label on the player's head with the seconds that the player has spent AFK.
Reply
#7

Quote:
Originally Posted by Shetch
Посмотреть сообщение
It doesn't make the player dissapear, but it creates a label on a player that is AFK. Also there is a 3D text label on the player's head with the seconds that the player has spent AFK.
Any way you could give me some code to make the player disappear?
Reply
#8

Just save the player's possition to a variable.

Код:
new playerPos[MAX_PLAYERS][3];

TogglePlayerSpectating(playerid, true); // dunno if it will make the player dissapear.
GetPlayerPos(playerid, playerPos[playerid][0], playerPos[playerid][1], playerPos[playerid][2]); // When the player goes afk.

SetPlayerPos(playerid, playerPos[playerid][0], playerPos[playerid][1], playerPos[playerid][2]); // when the player come back from afk.
TogglePlayerSpectating(playerid, false);
Reply
#9

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Just save the player's possition to a variable.

Код:
new playerPos[MAX_PLAYERS][3];

TogglePlayerSpectating(playerid, true); // dunno if it will make the player dissapear.
GetPlayerPos(playerid, playerPos[playerid][0], playerPos[playerid][1], playerPos[playerid][2]); // When the player goes afk.

SetPlayerPos(playerid, playerPos[playerid][0], playerPos[playerid][1], playerPos[playerid][2]); // when the player come back from afk.
TogglePlayerSpectating(playerid, false);
Where does that go exactly?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)