23.12.2009, 10:20
How to detect this, and how to set damage of X weapon?
SetDisabledWeapons Warning: This function is removed in SA-MP 0.3. Alternatively you can return 0 in OnPlayerUpdate if they use a bad weapon, and change their weapon
Originally Posted by Seif_
You can do that. All you need is simply a variable that detects the last shooter, and you can detect that by checking who lastly had a weapon and pressed the fire key.
Then, if OnPlayerHealthChange is called, you check if the shooter's angle was facing the victim. If so, he probably shot him. You should also check if they're in a range, not from SF to the LS docks, the guy was probably shooting facing the other player and the other player probably fell at the same time... And now to see the difference, you can make OnPlayerHealthChange detect the last HP and the new HP. You do last-new. OnPlayerHealthChange can be made using OnPlayerUpdate. |
Originally Posted by Μαστερμινδ
And weapons such as sawn-off and uzi you can face north and aim east/west at the
same time, which is what players usually do during fights, so facing angle doesnt count in situation like that. You cant script such a perfect 'who last shot you'-detection with pawno. |