SA-MP Forums Archive
Freeze on AFK? - 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: Freeze on AFK? (/showthread.php?tid=205460)



Freeze on AFK? - Hudgens - 01.01.2011

Made an AFK and back commands yet I need the player to be frozen if /AFK.

Whats the code you have to use to freeze the player during /AFK?

Код:
	if (strcmp("/Afk", cmdtext, true, 10) == 0)
		{
		new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
    	GetPlayerName(playerid, pname, sizeof(pname));
    	format(string, sizeof(string), "%s is now Away From Keyboard", pname);
    	SendClientMessageToAll(COLOR_ORANGE, string);
		return 1;
		}
		if (strcmp("/Back", cmdtext, true, 10) == 0)
		{
		new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
		GetPlayerName(playerid, pname, sizeof(pname));
		format(string, sizeof(string), "%s is now Back On Keyboard", pname);
		SendClientMessageToAll(COLOR_BRIGHTRED, string);
		return 1;
		}
	return 0;
	}



Re: Freeze on AFK? - Grim_ - 01.01.2011

https://sampwiki.blast.hk/wiki/TogglePlayerControllable


Re: Freeze on AFK? - Alex_Valde - 01.01.2011

https://sampwiki.blast.hk/wiki/Function:...erControllable ?


Re: Freeze on AFK? - Hudgens - 01.01.2011

Lol that was simple, thanks.


Re: Freeze on AFK? - Mean - 01.01.2011

Ye, lol, just in case:
pawn Код:
TogglePlayerControllable(playerid, true);
pawn Код:
TogglePlayerControllable(playerid, false);