SA-MP Forums Archive
Player Inactive ! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Player Inactive ! (/showthread.php?tid=91142)



Player Inactive ! - RaFsTar - 12.08.2009

I would like to know, if there is something that identifies that the player is not moving/driving (inactive).

Like if i dont player for 2 minutes, the server put me in a different world, but automatically. .

Best Regards.


Re: Player Inactive ! - arnutisz - 12.08.2009

Search for AFK script and modify it.


Re: Player Inactive ! - RaFsTar - 12.08.2009

Quote:
Originally Posted by Scott[LT
]
Search for AFK script and modify it.
I dont find what i want, auto AFK system...


Re: Player Inactive ! - MenaceX^ - 12.08.2009

What do you exactly need?


Re: Player Inactive ! - RaFsTar - 12.08.2009

Quote:
Originally Posted by MenaceX^
What do you exactly need?
Something that identifies that the player is not active.
Like if he does not press any key for 2 minutes, he is inactive.



Re: Player Inactive ! - urkiefly101 - 12.08.2009

get some admins..


Re: Player Inactive ! - RaFsTar - 12.08.2009

Quote:
Originally Posted by urkiefly101
get some admins..
OMG ..

I need this to stop counting the activity points when the player is inactive ? Do u think i need admins for that ?


Re: Player Inactive ! - Stas92 - 12.08.2009

This sounds quiet interest ..


Re: Player Inactive ! - Backwardsman97 - 12.08.2009

You could just have a repeating timer every 2 minutes that gets their position and checks if it is the same as when it last checked. Something like this.

pawn Код:
forward InactiveCheck();

new Float:PlayerX[MAX_PLAYERS];
new Float:PlayerY[MAX_PLAYERS];

//OnGameModeInit
SetTimer("InactiveCheck",120000,1);

public InactiveCheck()
{
    new Float:X,Float:Y,Float:Z;
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
            GetPlayerPos(i,X,Y,Z);
            if(X == PlayerX[i] && Y == PlayerY[i])
            {
              //They're inactive
            }
            else
            {
              PlayerX[i] = X;
              PlayerY[i] = Y;
            }
      }
    }
    return 1;
}
No need to see if they're Z is the same as last time. I don't think they will be able to move up and keep the same x,y.


Re: Player Inactive ! - RaFsTar - 13.08.2009

SetTimer("InactiveCheck",120000,1);

I think this should be on player spawn with:

SetTimerEx("InactiveCheck",120000,1,"i",playerid);

To create a counting for each player. Am i correct ?