Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
- {
- new pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- if(!strcmp(pname, "[PTM]MATRIX4057", true))
- {
- if(GetPlayerTeam(playerid) != GetPlayerTeam(damagedid))
- {
- if(damagedid != INVALID_PLAYER_ID)
- {
- new Float:HEALTH;
- new Float:ARMOR;
- new Float:DAMAGE;
- GetPlayerArmour(damagedid, ARMOR);
- GetPlayerHealth(damagedid, HEALTH);
- if(ARMOR > 0)
- {
- if(amount > ARMOR)
- {
- DAMAGE = amount - ARMOR;
- HEALTH = HEALTH - DAMAGE;
- SetPlayerArmour(damagedid, 0.0);
- SetPlayerHealth(damagedid, HEALTH);
- return 1;
- }
- ARMOR = ARMOR - amount;
- SetPlayerArmour(damagedid, ARMOR);
- }
- if(ARMOR < 1)
- {
- HEALTH = HEALTH - amount;
- SetPlayerHealth(damagedid, HEALTH);
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- SetPlayerTeam(playerid, 124);
- return 1;
- }
Add Comment
Please, Sign In to add comment