27.02.2018, 10:19
Hi guys, I have found out TogglePlayerControllable (TGP) does not work properly. I usually use this function for AFK system.
For example:
TGP works against hit by a weapon or a vehicle, but when I hit a player by fist, then I am able to kill him.
Is it there any solution, how fix that problem? Thanks in advance for a help
For example:
PHP Code:
new bool:isAFK[MAX_PLAYERS];
dcmd_afk(playerid, params[])
{
#pragma unused params
if(isAFK[playerid] == false)
{
TogglePlayerControllable(playerid, 0);
isAFK[playerid] = true;
}
else
{
TogglePlayerControllable(playerid, 1);
isAFK[playerid] = false;
}
}
Is it there any solution, how fix that problem? Thanks in advance for a help