OnPlayerShootPlayer wont damage other players - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerShootPlayer wont damage other players (
/showthread.php?tid=252848)
OnPlayerShootPlayer wont damage other players [SOLVED] -
Firzendxiw - 03.05.2011
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;
}
Re: OnPlayerShootPlayer wont damage other players -
[DM]Kane - 04.05.2011
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;
}
Re: OnPlayerShootPlayer wont damage other players [SOLVED] -
Firzendxiw - 04.05.2011
Wow thanks for the quick reply, I didn't think many would know about OPSP. But anyway your technique FREAKIN WORKED!!
DDDDD
Re: OnPlayerShootPlayer wont damage other players -
[DM]Kane - 04.05.2011
No problem mate