[HELP] How to make AFK system???
#1

Hello, i want to make an AFK system and i don't know how to. I know that there should be Timers that getplayerpos and then after a while get playerpos af if the positions the same player gets kicked, if not the same routine goes on, but could someone give me a hint where to start?
Reply
#2

Here study this:
Код:
if (strcmp("/afk", cmdtext, true, 10) == 0)
         {
		GameTextForPlayer(playerid, "~g~You are now ~r~Away From Keyboard",5000,3);
		TogglePlayerControllable(playerid,0);
		SetPlayerHealth(playerid,1000000);
		new string[256], pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(string, sizeof(string), "You are now Away From keyboard %s(/afk)", pname);
		SendClientMessageToAll(COLOR_RED, string);
		return 1;
	}
	if (strcmp("/back", cmdtext, true, 10) == 0)
        {
		GameTextForPlayer(playerid, "~g~You are now ~r~back on keyboard",5000,3);
		TogglePlayerControllable(playerid,1);
		SetPlayerHealth(playerid,100);
		new string[256], pname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(string, sizeof(string), "%s You are now back on keyboard(/back)", pname);
		SendClientMessageToAll(COLOR_RED, string);
		return 1;
	}
Sorry i can't explain you how to make this,i can give you CMD only because i didn't made this.
(I understand it i can make CMD easy i just have to deal with some virus and i don't know how to explain it very well because i'm newbie scripter).

Good luck.
Reply
#3

i'm trying to make an automatic one.
Reply
#4

Download this:
http://solidfiles.com/d/515a1/

pawn Код:
#include OnPlayerPause

public OnPlayerPause(playerid)
{
    new name[MAX_PLAYER_NAME], string[44];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s is now AFK.",name);
    SendClientMessageToAll(COLOR_GOLD, string);
    return 0;
}
 
public OnPlayerUnPause(playerid)
{
    new name[MAX_PLAYER_NAME], string[44];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "%s is BACK.",name);
    SendClientMessageToAll(COLOR_GOLD, string);
    return 0;
}
Reply
#5

I tried doing it like that, but it didn't work
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)