AFK Manager..
#4

For this you'll need ZCMD, and sscanf.
Place this in OnPlayerConnect
Code:
 PlayerInfo[playerid][pAfk] = 0;
The command that a player uses to go Afk.
Code:
COMMAND:afk(playerid, params[])
{
	new Float;originalX, Float:originalY, Float:originalZ;
	if(PlayerInfo[playerid][pAfk] == 0)
	{
	    GetPlayerPos(playerid, originalX, originalY, originalZ);
		PlayerInfo[playerid][pAfk] = 1;
		SetPlayerPos(playerid, //pos for the teleport location, your choice);
		new pName[MAX_PLAYER_NAME], str[128];
		GetPlayerName(playerid, pName, sizeof(pName));
		format(str, sizeof(str), "[SERVER]: %s (ID:%d) is now on AFK mode", pName, playerid);
		SendClientMessageToAll(COLOR_YELLOW, str);
		TogglePlayerControllable(playerid, 0);
	}
	else if(PlayerInfo[playerid][pAfk] == 1)
	{
		PlayerInfo[playerid][pAfk] = 0;
		SetPlayerPos(playerid, //pos for the teleport location, your choice);
		new pName[MAX_PLAYER_NAME], str[128];
		GetPlayerName(playerid, pName, sizeof(pName));
		format(str, sizeof(str), "[SERVER]: %s (ID:%d) is now off AFK mode", pName, playerid);
		SendClientMessageToAll(COLOR_YELLOW, str);
		TogglePlayerControllable(playerid, 1);
		SetPlayerPos(playerid, originalX, originalY, originalZ);
	}
	return 1;
}
This is what I understood from your question, hope that I helped you..
Reply


Messages In This Thread
AFK Manager.. - by Dr0gIraN - 01.06.2012, 12:51
Re: AFK Manager.. - by TzAkS. - 01.06.2012, 12:53
Re: AFK Manager.. - by OsamaBg - 01.06.2012, 12:55
Re: AFK Manager.. - by Sandiel - 01.06.2012, 12:58
Re: AFK Manager.. - by TzAkS. - 01.06.2012, 13:02
Re: AFK Manager.. - by Sandiel - 01.06.2012, 13:05

Forum Jump:


Users browsing this thread: 3 Guest(s)