Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- if(weaponid == 54)
- {
- pVida[playerid] = pVida[playerid] - amount;
- return 0;
- }
- if(playerid == INVALID_PLAYER_ID)
- {
- new Float:HP, Float:Colete, Float:Dano;
- GetPlayerArmour(playerid, Colete);
- GetPlayerHealth(playerid, HP);
- if(Colete > 0)
- {
- if(amount > Colete)
- {
- Dano = amount - Colete;
- HP = HP - Dano;
- pVida[playerid] = HP;
- pColete[playerid] = 0;
- return 1;
- }
- pColete[playerid] = Colete - amount;
- }
- if(Colete < 1)
- {
- HP = HP - amount;
- if(HP <= 0)
- {
- }
- else
- {
- pVida[playerid] = HP;
- }
- }
- }
- return 0;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
- {
- if(playerid != INVALID_PLAYER_ID)
- {
- switch(weaponid)
- {
- /*case 24: amount = 32;*/
- case 34: amount = 75;
- case 38: amount = 0;
- }
- PlayerPlaySound(damagedid, 6401, 0, 0, 0);
- new Float:HP, Float:Colete, Float:Dano;
- GetPlayerArmour(damagedid, Colete);
- GetPlayerHealth(damagedid, HP);
- if(Colete > 0)
- {
- if(amount > Colete)
- {
- Dano = amount - Colete;
- HP = HP - Dano;
- SetPlayerArmour(damagedid, 0.0);
- SetPlayerHealth(damagedid, HP);
- pVida[damagedid] = HP;
- pColete[damagedid] = 0;
- return 1;
- }
- pColete[damagedid] = Colete - amount;
- Colete = Colete - amount;
- SetPlayerArmour(damagedid, Colete);
- }
- if(Colete < 1)
- {
- HP = HP - amount;
- if(HP <= 0)
- {
- MatarPlayer(damagedid, playerid, weaponid);
- }
- else
- {
- SetPlayerHealth(damagedid, HP);
- pVida[damagedid] = HP;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement