Need Weapon Script - 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)
+--- Thread: Need Weapon Script (
/showthread.php?tid=496632)
Need Weapon Script -
Pillsbury536554 - 23.02.2014
Hello all, I am wondering if someone can help me find a Realistic Weapon Damage script for 0.3z. If anyone can find me one it would be thankful.
Filterscript or anything would work
Best Regards,
Devon Obrien
Re: Need Weapon Script -
Flake. - 23.02.2014
Seriously? Do you even bother to search.. There are loads of scripts for this.
Never the less..
pawn Код:
new Float:HP;
GetPlayerHealth(playerid, HP); //getting the players hp blah blah
if(weaponid == 23) SetPlayerHealth(playerid, HP-25); //If the player shoots someone with weapon id 23 it will take -25 damage of their current hp
if(weaponid == 25) SetPlayerHealth(playerid, HP-46); //same with this
Use something like that for OnPlayerTakeDamage
Re: Need Weapon Script -
Scenario - 23.02.2014
I think it's better to do it under OnPlayerShootWeapon, instead. That way, even if a desert eagle would normally give -50 damage, and you only want it to give -30, you wouldn't have to GIVE the player any health under OnPlayerGive/TakeDamage(). You could just return 0 under OnPlayerShootWeapon and handle the health damages yourself.