Pause Function?
#1

Is there any way so that when a player pauses a textdraw appears above his head saying "Paused Player"

and that he gets sent to /afk after 30 seconds.



Thank You,

Kevin
Reply
#2

Create3DTextLabel on get player key pressed ?... Just a guess, dunno if it would work. But it'd be cool :P
Reply
#3

that wouldnt work.. because players could just alt+tab....


i seen it on another server... XD
Reply
#4

Alt+tab counts the same as pausing.
Reply
#5

any more?
Reply
#6

OnPlayerUpdate is not called when a player is paused, you can use this to detect when a player is paused.
Reply
#7

Or use this:

Код:
new iLastUpdate[ MAX_PLAYERS ];

public OnPlayerUpdate( playerid )
{
   iLastUpdate[ playerid ] = GetTickCount();
   return 1;
}

stock IsPlayerPausing( iPlayerID )
{
   if(GetTickCount() > ( iLastUpdate[ iPlayerID ] + 2000 ))
   {
      return 1;
   }
   return 0;
}
Reply
#8

Quote:
Originally Posted by Matthias_
Посмотреть сообщение
Or use this:

Код:
new iLastUpdate[ MAX_PLAYERS ];

public OnPlayerUpdate( playerid )
{
   iLastUpdate[ playerid ] = GetTickCount();
   return 1;
}

stock IsPlayerPausing( iPlayerID )
{
   if(GetTickCount() > ( iLastUpdate[ iPlayerID ] + 2000 ))
   {
      return 1;
   }
   return 0;
}
Exactly, although i wouldn't do i EVERY updated. I would personally do it like ever 30 updates.
Reply
#9

Quote:
Originally Posted by Matthias_
Посмотреть сообщение
Or use this:
[...]
Lol that would fail miserably.
Reply
#10

Quote:
Originally Posted by Kevin_Joshen
Посмотреть сообщение
that wouldnt work.. because players could just alt+tab....


i seen it on another server... XD
*cough* sacnr
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)