Sniper
#1

Removed
Reply
#2

Use the Callback:
Код:
public OnPlayerShootPlayer(shooter,target,Float:damage)
And here is a simple example:

pawn Код:
public OnPlayerShootPlayer(shooter,target,Float:damage)
{
    new Float:HP;
    GetPlayerHealth(target, HP); // Here we will take the player current health
    if(GetPlayerWeapon(shooter) == 34) SetPlayerHealth(target, HP-100); // This will kill the target from 1 shoot
    return 1;
}
Reply
#3

Use simple code for adjusting health and armour with damage.

Код:
Damage(playerid, Float:health, Float:armour, Float:damage)
{
	armour -= damage; //Will decrease
	if(armour <= 0.0) //if armour is lower or equal to 0.0 do..
	{
		armour = 0.0;
		health -= damage;
		if(health <= 0.0) health = 0.0;
	}
	SetPlayerHealth(playerid, health);
	SetPlayerArmour(playerid, armour);
}
Use in OnPlayerShootPlayer:

Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
        switch(GetPlayerWeapon(Shooter)) //Switchs shooters weaponid
        {
       		 case 34: {
			HealthAdjust(Target, HealthLost, ArmourLost, 35.0); } //Default weapon damage + your custom damage
	}
Code above is only for health damage and won't work if player have armour.
Reply
#4

Download this to use the post above:

http://forum.sa-mp.com/showthread.ph...yershootplayer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)