Freeze on AFK?
#1

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;
	}
Reply
#2

https://sampwiki.blast.hk/wiki/TogglePlayerControllable
Reply
#3

https://sampwiki.blast.hk/wiki/Function:...erControllable ?
Reply
#4

Lol that was simple, thanks.
Reply
#5

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


Forum Jump:


Users browsing this thread: 2 Guest(s)