Setting weapons damage dealt. - 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: Setting weapons damage dealt. (
/showthread.php?tid=405304)
Setting weapons damage dealt. -
Tamer - 06.01.2013
I would like to set the weapons damage dealt for every weapon.
Simply,when a player has a variable=1; and having an m4 on their hand,shooting to another player,making the m4 damage dealt per bullet to 50,instead of 25. Can someone help me? I don't want it to make one shot one kill,as I have that aldready for knife-stab attack.
I want it to work like every bullet that hits the target will deal more damage than usual.
Is there a function for this? I got the OPSP call back. I need the function that can set the bullet damage.
Would this sort it out?
http://forum.sa-mp.com/showthread.ph...+bullet+damage
Re: Setting weapons damage dealt. -
JM_Millers - 06.01.2013
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(weaponid == 31 && variable == 1) //! variable
{
new Foat:health;
if(GetPlayerHealth(playerid, health))
{
SetPlayerHealth(playerid, health-amount);
}
}
}
return 1;
}
Re: Setting weapons damage dealt. -
JM_Millers - 06.01.2013
Or:
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) {
if(variable == 1)
{
new Foat:health;
GetPlayerHealth(playerid, health);
switch(weaponid)
{
case 31: SetPlayerHealth(playerid,health-50);
}
}
return true;
}
Re: Setting weapons damage dealt. -
Konstantinos - 06.01.2013
JM_Millers, please don't double post, just edit your post.
I'd recomment the first way you did, because not everytime does damage 25.