Weapon damage!!
#1

hi,

im using the OnPlayerShootPlayer include with this code in my gamemode:

pawn Код:
public OnPlayerShootPlayer(shooter,target,Float:damage)
{
    new Float:H[2];
    GetPlayerHealth(target, H[0]);
    GetPlayerArmour(target,H[1]);
    if(GetPlayerWeapon(shooter) == 34)//this is a sniper
    {
        if(H[1] > 0) return SetPlayerArmour(target,0);
        SetPlayerHealth(target, H[0]-100);
    }
    return 1;
}
I want that u die instantly if hit by a sniper, no matter how much life or armor u got.
This works just perfectly as long as i shoot a player from a low distance.
As soon as a shoot a player from a longer distance it does not work anymore.
Could someone pls help me? PLs tell me what could be the problem.

regards, BlackWolf120.
Reply
#2

Maybe try to make it simple like this:

Код:
if(GetPlayerWeapon(shooter) == 34)
{
SetPlayerHealth(target, 0);
SetPlayerArmour(target, 0);
}
return 1;
}
Reply
#3

hi,
thx for ur answer.
This would really work?
Reply
#4

The distance for OnPlayerShootPlayer is measured in the include, you need to increase that distance, I'm not sure how to do this as i have no idea what that include looks like.
Reply
#5

mhh, would be great if someone could tell me how to increase the distance
heres the inlcude on pastebin: http://pastebin.com/tDxSPhqA
would be very happy about an answer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)