Some players appear afk,but there are not!
#1

Hello everybody!

My problem is that some players for example two appear afk to the rest of the players but they say that there are not AFK.The AFK players client shows that they move they can do everything but for the rest of the players it shows that there are AFK,they stay at the spawn and can nothing to do.
Also after a server restart there are still AFK,but if they join with an another nickname the server there don't appear afk anymore..
I don't know why is this happening,so please help me..
Reply
#2

I have the same problem due to losing updates from the server i guess it's from 0.3x-r2 client.
Reply
#3

I think you have to reset the variables on every connect and disconnect.

For Example:
pawn Код:
public OnPlayerConnect (playerid)
{
      PlayerInfo[ playerid ][ isAFK ] = 0;
      return 1;
}

public OnPlayerDisconnect (playerid, reason)
{
     PlayerInfo[ playerid ][ isAFK ] = 0;
     return 1;
}
Reply
#4

Quote:
Originally Posted by SyntaxQ
Посмотреть сообщение
I think you have to reset the variables on every connect and disconnect.

For Example:
pawn Код:
public OnPlayerConnect (playerid)
{
      PlayerInfo[ playerid ][ isAFK ] = 0;
      return 1;
}

public OnPlayerDisconnect (playerid, reason)
{
     PlayerInfo[ playerid ][ isAFK ] = 0;
     return 1;
}
I don't think that the problem is this because if the variable it would be 1 the player could not write messages but he can and we saw his messages in the chat!
Reply
#5

Show me your commands (/afk, /back)..
Reply
#6

Command /afk:
pawn Код:
CMD:afk( playerid, params[ ] )
{
    if ( PlayerInfo[ playerid ][ isafk ] == 1 )
        Announce( playerid, "~r~ERROR!: ~y~You are already in AFK mode!", 4000, 4 );

    new Float:x, Float:y, Float:z;
    gsString[ 0 ] = EOS;
    foreach(new i: Player) if ( PlayerInfo[ i ][ HideTDSSSS ] != 1 )
    {
        format( gsString, 144, "~r~ ~n~  ~n~  ~n~  ~n~  ~n~  ~n~ ~n~ ~n~ ~r~ %s ~w~ is now ~g~AFK.", PlayerName( playerid ) );
        GameTextForAll( gsString, 4000, 3 );
    }
    TogglePlayerControllable( playerid, 0 );
    SetPlayerVirtualWorld( playerid, ( playerid + 1 ) );
   
    SetPlayerPos( playerid, 2736.9937, -1758.0190, 17.4084 );
    SetPlayerFacingAngle( playerid, 145.8286 );
   
    TogglePlayerControllable( playerid, false );
    SetTimerEx( "ToggleTrue", 4000, 0, "d", playerid );

    PlayerInfo[ playerid ][ isafk ] = 1;
    GetPlayerPos( playerid, x, y, z );
    SetPVarFloat( playerid, "X", x );
    SetPVarFloat( playerid, "Y", y );
    SetPVarFloat( playerid, "Z", z );
    return ( 1 );
}
Command /back:
pawn Код:
CMD:back( playerid, params[ ] )
{
    if ( PlayerInfo[ playerid ][ isafk ] == 0 )
        Announce( playerid, "~r~ERROR!: ~y~You are not ~r~AFK ~y~or ~r~BRB.", 4000, 4 );

    gsString[ 0 ] = EOS;
    foreach(new i: Player) if ( PlayerInfo[ i ][ HideTDSSSS ] != 1 )
    {
        format( gsString, sizeof( gsString ), "~r~ ~n~  ~n~  ~n~  ~n~  ~n~  ~n~  ~n~ ~n~ ~n~ ~r~ %s ~w~ is now ~g~back.", PlayerName( playerid ) );
        GameTextForAll( gsString, 4000, 3 );
    }
    SetPlayerPos( playerid, GetPVarFloat( playerid, "X" ), GetPVarFloat( playerid, "Y" ), GetPVarFloat( playerid, "Z" ) );
    SetPlayerVirtualWorld( playerid, 0 );
    PlayerInfo[ playerid ][ isafk ] = 0;
    return ( 1 );
}
And the variables are resetted at OnPlayerConnect and OnPlayerDisconnect
Reply
#7

pawn Код:
CMD:afk ( playerid, params[] )
{
      if ( PlayerInfo[ playerid ][ isafk ] == 1 )
        Announce( playerid, "~r~ERROR!: ~y~You are already in AFK mode!", 4000, 4 );
      PlayerInfo[ playerid ][ isafk] = 1;
      TogglePlayerControllable( playerid, 0 );
      // You can add all those GameTexts here..
      return 1;
}
pawn Код:
CMD:back ( playerid, params[] )
{
      if ( PlayerInfo[ playerid ][ isafk ] == 0 )
        Announce( playerid, "~r~ERROR!: ~y~You are not ~r~AFK ~y~or ~r~BRB.", 4000, 4 );
      PlayerInfo[ playerid ][ isafk ] = 0;
      TogglePlayerControllable( playerid, 1 );
      // You can add all those GameTexts here..
      return 1;
}
Sorry, but I don't know how those timers work..
Reply
#8

Quote:
Originally Posted by SyntaxQ
Посмотреть сообщение
pawn Код:
CMD:afk ( playerid, params[] )
{
      if ( PlayerInfo[ playerid ][ isafk ] == 1 )
        Announce( playerid, "~r~ERROR!: ~y~You are already in AFK mode!", 4000, 4 );
      PlayerInfo[ playerid ][ isafk] = 1;
      TogglePlayerControllable( playerid, 0 );
      // You can add all those GameTexts here..
      return 1;
}
pawn Код:
CMD:back ( playerid, params[] )
{
      if ( PlayerInfo[ playerid ][ isafk ] == 0 )
        Announce( playerid, "~r~ERROR!: ~y~You are not ~r~AFK ~y~or ~r~BRB.", 4000, 4 );
      PlayerInfo[ playerid ][ isafk ] = 0;
      TogglePlayerControllable( playerid, 1 );
      // You can add all those GameTexts here..
      return 1;
}
Sorry, but I don't know how those timers work..
Thanks for the code,but i'm pretty sure that is not from the AFK system..It must be something else..
Anyway,i will test it
Reply
#9

Still have the problem...Someone?
Reply
#10

Do you have ping kick system ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)