Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
- {
- new TargetName[MAX_PLAYER_NAME];
- new ShooterName[MAX_PLAYER_NAME];
- GetPlayerName(Target,TargetName,MAX_PLAYER_NAME);
- GetPlayerName(Shooter,ShooterName,MAX_PLAYER_NAME);
- new gun=GetPlayerWeapon(Shooter);
- new string[128];
- new wepname[30];
- GetWeaponName(gun,wepname,sizeof(wepname));
- format(string,sizeof(string),"~n~~n~~w~You hit ~r~%s ~w~Damage:~r~ %i ~w~Weapon:~r~%s",TargetName,floatround(HealthLost+ArmourLost),wepname);
- GameTextForPlayer(Shooter,string,3000,5);
- format(string,sizeof(string),"~n~~n~~w~You got hit by ~r~%s ~w~Damage:~r~ %i ~w~Weapon:~r~%s",ShooterName,floatround(HealthLost+ArmourLost),wepname);
- GameTextForPlayer(Target,string,3000,5);
- new Float:health, Float:armour;
- GetPlayerHealth(Target,health);
- GetPlayerArmour(Target,armour);
- if(ArmourLost > 0.0) SetPlayerArmour(Target,floatadd(armour,ArmourLost));
- if(HealthLost > 0.0) SetPlayerHealth(Target,floatadd(health,HealthLost));
- new Damage;
- switch(GetPlayerWeapon(Shooter)) {
- case 24: Damage = 40; //case [weaponid]: Damage = [damage];
- case 31,28: Damage = 25; //Tec9 & Micru-Uzi
- case 29: Damage = 30;
- case 0: Damage = 7;
- case 22: Damage = 25;
- case 23: Damage = 20;
- case 5,3,6,7,2: Damage = 10;
- case 4: Damage = 30;
- case 25: Damage = 50;
- case 26: Damage = 50;
- case 30: Damage = 30;
- case 33,34: Damage = 95;
- }
- armour = armour - Damage;
- if(armour < 0.0) {
- health += armour; //Health will decrease because armour is negative. (a + (-b) = a - b)
- if(health <= 0.0) {
- health = 0.0;
- }
- armour = 0.0;
- }
- SetPlayerHealth(Target, health);
- SetPlayerArmour(Target, armour);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement