06.09.2015, 09:56
How i must to use to detect when player use godmode ? i try with that but don`t works.
And This on OnPlayerTakeDamage. What else can I do?
PHP код:
GetPlayerHealth(playerid, health);
AntiCheatInfo[playerid][acOldHealth] = health; //OnPlayerUpdate();
PHP код:
if(!IsPlayerPaused(playerid) && amount > 0.0)
{
GetPlayerHealth(playerid, health);
if(health == AntiCheatInfo[playerid][acOldHealth])
{
WarningsGodmode[playerid] ++;
SendClientMessage(playerid, COLOR_RED, "WARNING! Please stop using godmode cheats or you will get banned !");
format(string, sizeof(string), "WARNING: %s is suspected to using godmode cheats !", PlayerInfo[playerid][pUsername]);
SendMessageToAdmins(1, COLOR_YELLOW, string);
PlayerInfo[playerid][pFreezeTime] += 5;
TogglePlayerControllable(playerid, 0);
//SetPlayerHealtEx(playerid, health-amount);
if(WarningsGodmode[playerid] >= 5)
{
format(string, sizeof (string), "AdmCmd: %s has been kicked by AdmBot, reason: using cheats (godmode)",PlayerInfo[playerid][pUsername]);
KickWithMessage(playerid, COLOR_LIGHTRED, string);
}
}
}