Advertisement
Infra_

[SA-MP] Fake Kill Detection

Jun 11th, 2015
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.72 KB | None | 0 0
  1. new bool:PlayerAttacked[MAX_PLAYERS][MAX_PLAYERS];
  2.  
  3. public OnPlayerConnect(playerid) {
  4.     for (new var = 0; var <= GetPlayerPoolSize(); var++) {
  5.         PlayerAttacked[playerid][var] = false;
  6.         PlayerAttacked[var][playerid] = false;
  7.     }
  8.     return true;
  9. }
  10.  
  11. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) {
  12.     if (issuerid != INVALID_PLAYER_ID)
  13.         PlayerAttacked[issuerid][playerid] = true;
  14.     return true;
  15. }
  16.  
  17. public OnPlayerDeath(playerid, killerid, reason) {
  18.     if (killerid != INVALID_PLAYER_ID) {
  19.         if (!PlayerAttacked[killerid][playerid]) {
  20.             // Ban or w/e
  21.             return true;
  22.         }
  23.     }
  24.     for (new var = 0; var <= GetPlayerPoolSize(); var++)
  25.         PlayerAttacked[var][playerid] = false;
  26.     return true;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement