SA-MP Forums Archive
Godmode - 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)
+--- Thread: Godmode (/showthread.php?tid=588173)



Godmode - jamal1992 - 06.09.2015

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


Re: Godmode - jamal1992 - 06.09.2015

Solved ! I move the codes to OnPlayerGiveDamage and works fine.