Really need anti fake kill.
#3

pawn Код:
new deathdata[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
      deathdata[playerid] = INVALID_PLAYER_ID;
      return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
      deathdata[playerid] = INVALID_PLAYER_ID;
      return 1;
}

public OnPlayerSpawn(playerid)
{
       deathdata[playerid] = INVALID_PLAYER_ID;
       return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
       if(deathdata[playerid] == INVALID_PLAYER_ID)
       {
               deathdata[playerid] = killerid;
               deathdata[killerid] = playerid;
       }
       return 1;
}

stock DeathMessage(playerid, killerid, reason)
{
      if(deathdata[playerid] == killerid && deathdata[killerid] == playerid)
      {
              deathdata[playerid] = INVALID_PLAYER_ID;
              deathdata[killerid] = INVALID_PLAYER_ID;
              return SendDeathMessage(playerid, killerid, reason);
      }
      else return false;
}
Make sure you hook DeathMessage func with SendDeathMessage. So as to completely run the death list with vars.
Hook the callbacks as well and use as an include.

NOTE:
- You can only send a death message if the player has killed the other player
- Function will return false if the player wasnt killed by the specified killer
- Death data of player will reset on spawn i.e. you must send death message before spawn

** Though i am not sure if this will work but anything is better than nothing AND this to prevent fake death messages.
Reply


Messages In This Thread
Really need anti fake kill. - by VenomMancer - 22.03.2015, 06:13
Re: Really need anti fake kill. - by JaydenJason - 22.03.2015, 07:45
Re: Really need anti fake kill. - by Gammix - 22.03.2015, 07:59
Re: Really need anti fake kill. - by MBilal - 22.03.2015, 09:42

Forum Jump:


Users browsing this thread: 1 Guest(s)