Trying to make anti health hack
#4

It's a bit more complicated than that Remba, I'm sorry I should have explained this you need to set all players to the same team so they can't damage each other otherwise they will be taking double damage. You will also need some variables to indicate who killed the player so that OnPlayerDeath() knows who killed the player.

Here is the basic logic structure.
pawn Код:
new KilledBy[MAX_PLAYERS];
new KillReason[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    ...
    // Killed by no one (reset each spawn)
    KilledBy[playerid] = INVALID_PLAYER_ID;
}

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    ...
    // Player was killed set their killer id
    KilledBy[damagedid] = playerid;
    KillReason[damagedid] = weaponid;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    // Player was killed by another player set the killerid
    if(KilledBy[playerid] != INVALID_PLAYER_ID)
    {
        killerid = KilledBy[playerid];
        reason = KillReason[damagedid];
    }
    return 1;
}
Reply


Messages In This Thread
Trying to make anti health hack - by Remba031 - 28.03.2014, 22:01
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 22:10
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 22:21
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 22:45
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 22:55
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 23:03
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 23:29
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 23:34
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 23:40
Re: Trying to make anti health hack - by Pottus - 29.03.2014, 00:02

Forum Jump:


Users browsing this thread: 5 Guest(s)