OnPlayerShootPlayer wont damage other players
#1

Hey all, new to these forums. I've recently downloaded OPSP.inc and added #include <OPSP> so nothing wrong there. But I cant get my player to damage the other players according to the amount I set. If you could help out it would be appreciated.

Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
	new Float:Health;
	GetPlayerHealth(Target, Health);
	if(gTeam[Shooter] == TEAM_GROUP && (gTeam[Target] == TEAM_GROUP1 || gTeam[Target] == TEAM_GROUP2 || gTeam[Target] == TEAM_GROUP3))
	{
		if(GetPlayerWeapon(Shooter) == 0 && (test < 64800 && test > 28800))
		{
			HealthLost = Health-50;
			SetPlayerHealth(Target, HealthLost);
		}
		else if(GetPlayerWeapon(Shooter) == 0 && (test > 64800 || test < 28800))
		{
			HealthLost = Health-25;
			SetPlayerHealth(Target, HealthLost);
		}
		else if(GetPlayerWeapon(Shooter) == 4 && (test < 64800 && test > 28800))
		{
			HealthLost = Health-100;
			SetPlayerHealth(Target, HealthLost);
		}
		else if(GetPlayerWeapon(Shooter) == 4 && (test > 64800 || test < 28800))
		{
			HealthLost = Health-50;		
			SetPlayerHealth(Target, HealthLost);
		}
	}
	return 1;
}
Reply
#2

Maybe you should try this
pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    new Float:Health, Float:TotalHealthLost;

    GetPlayerHealth(Target, Health);
    if(gTeam[Shooter] == TEAM_GROUP && (gTeam[Target] == TEAM_GROUP1 || gTeam[Target] == TEAM_GROUP2 || gTeam[Target] == TEAM_GROUP3))
    {
        if(GetPlayerWeapon(Shooter) == 0 && (test < 64800 && test > 28800))
        {
            TotalHealthLost = HealthLost+50;
            SetPlayerHealth(Target, Health-TotalHealthLost);
        }
        else if(GetPlayerWeapon(Shooter) == 0 && (test > 64800 || test < 28800))
        {
            TotalHealthLost = HealthLost+25;
            SetPlayerHealth(Target, Health-TotalHealthLost);
        }
        else if(GetPlayerWeapon(Shooter) == 4 && (test < 64800 && test > 28800))
        {
                        TotalHealthLost = HealthLost+100;
            SetPlayerHealth(Target, Health-TotalHealthLost);
        }
        else if(GetPlayerWeapon(Shooter) == 4 && (test > 64800 || test < 28800))
        {
                        TotalHealthLost = HealthLost+50;
            SetPlayerHealth(Target, Health-TotalHealthLost);
        }
    }
    return 1;
}
Reply
#3

Wow thanks for the quick reply, I didn't think many would know about OPSP. But anyway your technique FREAKIN WORKED!! DDDDD
Reply
#4

No problem mate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)