SA-MP Forums Archive
help!!!!!!!! - 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: help!!!!!!!! (/showthread.php?tid=158053)



help!!!!!!!! - keller012 - 08.07.2010

How do I get a player can only AFK Fik stopped after 10s?

I use this cmd to stay afk

Код:
{
    GetPlayerName(playerid, Name, 24);
	if (strcmp("/afk", cmdtext, true, 10) == 0)
	{
	    if(Afk[playerid]==0){
		Afk[playerid]=1;
		Timer[playerid] = SetTimer("SendMessage",100,0);
		SetPlayerVirtualWorld(playerid, 15);
		TogglePlayerControllable(playerid,0);
        format(string, sizeof(string), "%s this afk", Name);
        SendClientMessageToAll(0x33CCFFAA, string);
		}else{SendClientMessage(playerid,0xFF0000AA, "You're on AFK mode to exit type /exitafk");}
		return 1;
	}



Re: help!!!!!!!! - keller012 - 08.07.2010

nobody knows how?


Re: help!!!!!!!! - CAR - 08.07.2010

pawn Код:
// somewhere on the bottom of your script
forward NoAFK(playerid);
public NoAFK(playerid);
{
   Afk[playerid] = 0;
}

// In Your Command
SetTimerEx("NoAFK", 10000, false, "d", playerid);