Advertisement
AleeFerreira

Escudo Policial

May 19th, 2012
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.86 KB | None | 0 0
  1. #if defined _aEscudo_included
  2.   #endinput
  3. #endif
  4.  
  5. #define _aEscudo_included
  6. #include <a_samp>
  7. #define CallBack:_%1(%2) forward_%1(%2); \ public_%1(%2)
  8. #define Slot (3)
  9. #define MAX_DANO (15)
  10. static damage[MAX_PLAYERS];
  11.  
  12. CallBack:a_OnPlayerTakeDamage(playerid, issuerid){
  13.     if(issuerid != INVALID_PLAYER_ID){
  14.         if(IsPlayerAttachedObjectSlotUsed(playerid, Slot)){
  15.             if(damage[playerid] < MAX_DANO) ++damage[playerid], SetPlayerHealth(playerid, 100.0);
  16.             else if(damage[playerid] > MAX_DANO) damage[playerid] = 0, RemovePlayerAttachedObject(playerid, Slot);
  17.         }
  18.     }
  19.     return true;
  20. }
  21.        
  22. CallBack:a_OnPlayerGiveDamage(playerid, damagedid, Float: amount){
  23.     if(damagedid != INVALID_PLAYER_ID){
  24.         if(IsPlayerAttachedObjectSlotUsed(damagedid, Slot)){
  25.             if(damage[damagedid] < MAX_DANO) amount = 10.0;
  26.         }
  27.     }
  28.     return true;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement