Need help with checking if a players been afk longer than 15 mins :D
#1

So far ive got the afk and back system inplace but need help with checking if the player has been afk longer than 15 mins help? the timers in for the check but dont know what to put >_<'

Код:
#include <a_samp>

public OnGameModeInit()
{
SetTimer("AFKCHECKER", 900000, true);
}

forward AFKCHECKER

public OnCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/afk", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
			new PlayerText3D:playertextid;
    		new Float:X, Float:Y, Float:Z;
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			format(string, sizeof(string), "* AFK: Player %s is now AFK ", sendername);
			TogglePlayerControllable(playerid, 0)
    		GetPlayerPos( playerid, X, Y, Z );
    		playertextid = CreatePlayer3DTextLabel(playerid, "AFK: %s is afk", COLOR_GREEN, x, y, z, 30);
    		Attach3DTextLabelToPlayer(playertextid, playerid, y, x, z)
    		return 1;
    		}
		}
		
if(strcmp(cmd, "/back", true) == 0)
        {
            if(IsPlayerConnected(playerid))
            {
            Delete3DTextLabel(playertextid);
			TogglePlayerControllable(playerid, 1)
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			format(string, sizeof(string), "* AFK: Player %s is now BACK from AFK ", sendername);
			return 1;
			}
		}
}

public AFKCHECKER
{
}
Reply


Messages In This Thread
Need help with checking if a players been afk longer than 15 mins :D - by peterRook - 21.06.2011, 03:09
Re: Need help with checking if a players been afk longer than 15 mins :D - by Basicz - 21.06.2011, 03:39

Forum Jump:


Users browsing this thread: 1 Guest(s)