SA-MP Forums Archive
OnPlayerShootPlayer bugs - 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: OnPlayerShootPlayer bugs (/showthread.php?tid=444849)



OnPlayerShootPlayer bugs - Stefand - 18.06.2013

Hello,

My anticheat keeps banning people who have been tased...

pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    if(Player[Shooter][HasTaser] == 1)
    {
        if(GetPlayerWeapon(Shooter) == 23)
        {
            Player[Target][Tased] = 1;
            new Float: PHealth;
            GetPlayerHealth(Target, PHealth);
            Player[Target][Health] = PHealth+HealthLost;
            SetPlayerHealth(Target, PHealth+HealthLost);
            TogglePlayerControllable(Target, false);
            ApplyAnimation(Target, "CRACK", "crckidle4", 4.0, 1, 0, 0, 0, 0);
            SetTimerEx("TaserClear",7000,false,"d",Target);
        }
    }
    return 1;
}
pawn Код:
public AntiCheat()
{
    foreach(Player, i)
    {
        if(Authenticated[i] == 1)
        {
            if(Player[i][AntiCheatExemption] == 0)
            {
                new PMoney = GetPlayerMoney(i);
                new Float: PArmour; GetPlayerArmour(i, PArmour);
                new Float: PHealth; GetPlayerHealth(i, PHealth);
                if(PMoney > Player[i][Money]){ServerBan(i, "Money Hack");}
                if(Player[i][Tased] == 0)
                {
                    if(PArmour > Player[i][Armour]){ServerBan(i, "Armour Hack");}
                    if(PHealth > Player[i][Health]){ServerBan(i, "Health Hack");}
                }
At the "TaserClear" Public, it sets the Tased to 0


Re: OnPlayerShootPlayer bugs - KingHual - 18.06.2013

Stop using outdated includes when native callbacks like https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage exist


Re: OnPlayerShootPlayer bugs - Stefand - 18.06.2013

How could I make that Taser system work then?


Re: OnPlayerShootPlayer bugs - Stefand - 18.06.2013

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(playerid != INVALID_PLAYER_ID)
    {
        if(Player[issuerid][HasTaser] == 1)
        {
            if(GetPlayerWeapon(issuerid) == 23)
            {
                Player[playerid][Tased] = 1;
                Player[playerid][Health] += amount;
                SetPlayerHealth(playerid, Player[playerid][Health]+amount);
                TogglePlayerControllable(playerid, false);
                ApplyAnimation(playerid, "CRACK", "crckidle4", 4.0, 1, 0, 0, 0, 0);
                SetTimerEx("TaserClear",7000,false,"d",playerid);
            }
        }
    }
    return 1;
}
Like that?


Re: OnPlayerShootPlayer bugs - Stefand - 19.06.2013

^


Re: OnPlayerShootPlayer bugs - Stefand - 19.06.2013

I tried this one, but it gives the player IG 118 Health and the status keeps the same..


Re: OnPlayerShootPlayer bugs - Necip - 19.06.2013

What do you mean with "The status keeps the same.." ?


Re: OnPlayerShootPlayer bugs - Stefand - 19.06.2013

well I have a "Health" Status in the player data, so when a player uses hacks to restore their health it does not update their status, so the anticheat sees it as a hack.


Re: OnPlayerShootPlayer bugs - Stefand - 20.06.2013

Bump


Re: OnPlayerShootPlayer bugs - SwisherSweet - 20.06.2013

stop bumping you bumped like 5 times in this tread looks like your begging for a ban.