SA-MP Forums Archive
[Include] weapon-config.inc - Damage system with many features - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] weapon-config.inc - Damage system with many features (/showthread.php?tid=563387)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


Re: weapon-config.inc - Damage system with many features - Crayder - 11.07.2015

Quote:

What is SetDisableSyncBugs doing?

This is to fix certain sync bugs (pretty self explanatory, ehh), such as the 'knifed' sync.
Quote:

I am looking to figure out how SetCustomFallDamage works.

This is like the most complicated part of the include. Slice still hasn't got it 100% figured out, but it does work. Refer to the github readme for this stuff.

About the spawn-get-skin, you should report that on the github.


Re: weapon-config.inc - Damage system with many features - Jeroen52 - 11.07.2015

Quote:
Originally Posted by Crayder
Посмотреть сообщение
This is to fix certain sync bugs (pretty self explanatory, ehh), such as the 'knifed' sync.This is like the most complicated part of the include. Slice still hasn't got it 100% figured out, but it does work. Refer to the github readme for this stuff.

About the spawn-get-skin, you should report that on the github.
It does seem like one of the most ocmplicated part.

I have a little problem with the health bar textdraw, it isn't on my health bar correctly.
Don't get me wrong it is still visible, it is just not on there correctly.



I also adjusted the damage of the AK using this
Код:
SetWeaponDamage(31, DAMAGE_TYPE_STATIC, 11.90);
But I still deal out the default damage of the AK (9.90).

Edit: I placed it in OnGamemodeInit.
Edit2: Silly me, AK is weapon ID 30.
Edit3: Since health is server sided, both health and armour can't be hacked anymore, right?
Edit4: If you have a list of SetWeaponShootRate(weaponid, max_rate); for weapons you can c-bug, can you send it?


Re: weapon-config.inc - Damage system with many features - Crayder - 12.07.2015

[QUOTE=Jeroen52;3517690]Edit3: Since health is server sided, both health and armour can't be hacked anymore, right?
Edit4: If you have a list of SetWeaponShootRate(weaponid, max_rate); for weapons you can c-bug, can you send it?/QUOTE]

@3: True. Neither can be hacked.
@4: I don't have a list, but I could make one. However, if you are trying to prevent C-Bug, it's think already being done by default. To test it put some debug messages in OnRejectedHit and try to C-Bug.


Re: weapon-config.inc - Damage system with many features - Jeroen52 - 12.07.2015

[quote=Crayder;3518057]
Quote:
Originally Posted by Jeroen52
Посмотреть сообщение
Edit3: Since health is server sided, both health and armour can't be hacked anymore, right?
Edit4: If you have a list of SetWeaponShootRate(weaponid, max_rate); for weapons you can c-bug, can you send it?/QUOTE]

@3: True. Neither can be hacked.
@4: I don't have a list, but I could make one. However, if you are trying to prevent C-Bug, it's think already being done by default. To test it put some debug messages in OnRejectedHit and try to C-Bug.
I have tried to c-bug, and I am bad at c-bugging.
I was able to kill someone within 1 second with the Deagle.


Re: weapon-config.inc - Damage system with many features - Crayder - 12.07.2015

[quote=Jeroen52;3518535]
Quote:
Originally Posted by Crayder
Посмотреть сообщение
I have tried to c-bug, and I am bad at c-bugging.
I was able to kill someone within 1 second with the Deagle.
Download an auto-cbug or rapid-fire mod, they are both disregarded when using this include.


Re: weapon-config.inc - Damage system with many features - Slice - 13.07.2015

The rates are set default to allow cbug rapid-fire.

Here's what I use for my c-bug skinhit server:
pawn Код:
SetWeaponDamage(
        WEAPON_SNIPER,
        DAMAGE_TYPE_RANGE,
        45.0,
        4.0, 35.0,
        90.0, 30.0
    );

    SetWeaponDamage(
        WEAPON_RIFLE,
        DAMAGE_TYPE_RANGE,
        37.5,
        4.0, 30.0
    );

    SetWeaponDamage(
        WEAPON_DEAGLE,
        DAMAGE_TYPE_RANGE,
        35.0,
        25.0, 25.0
    );

    SetWeaponDamage(
        WEAPON_SILENCED,
        DAMAGE_TYPE_STATIC,
        15.0
    );

    SetWeaponDamage(
        WEAPON_PISTOLWHIP,
        DAMAGE_TYPE_STATIC,
        10.0
    );

    SetWeaponDamage(
        WEAPON_M4,
        DAMAGE_TYPE_STATIC,
        8.0
    );

    SetWeaponDamage(
        WEAPON_AK47,
        DAMAGE_TYPE_STATIC,
        11.5
    );

    SetVehiclePassengerDamage(true);
    SetDamageSounds(1190, 17802);
    SetWeaponMaxRange(WEAPON_RIFLE, 140.0);
    SetWeaponMaxRange(WEAPON_M4,    100.0);
    SetWeaponMaxRange(WEAPON_DEAGLE, 40.0);
    SetWeaponMaxRange(WEAPON_SHOTGUN,50.0);
    SetWeaponMaxRange(WEAPON_AK47,  100.0);

    SetCustomFallDamage(true, 40.0, -0.75);
    SetDamageFeed(true);
    SetDisableSyncBugs(true);
    SetCustomVendingMachines(false);
Also, in OnPlayerDamage:
pawn Код:
if (weapon == WEAPON_CARPARK || weapon == WEAPON_HELIBLADES)
    {
        return 0;
    }

    if (weapon == WEAPON_COLLISION && amount <= 5.0)
    {
        return 0;
    }

    new avg_rate = AverageShootRate(issuerid, 2);

    // Lower rapid fire damage
    if (avg_rate != -1) {
        if (weapon == WEAPON_DEAGLE && avg_rate < 500) {
            amount /= 1.4;
        } else if (weapon == WEAPON_SHOTGSPA && avg_rate < 250) {
            amount /= 1.4;
        }
    }

    // Silencer headshot
    if (weapon == WEAPON_SILENCED && bodypart == 9) {
        amount = 30.0;
    }

    // Rifle headshot
    if (weapon == WEAPON_RIFLE && bodypart == 9)
    {
        amount /= 0.75;
    }

    // Sniper headshot
    if (weapon == WEAPON_SNIPER && bodypart == 9) {
        if (amount == 30.0) {
            amount = 40.0;
        } else if (amount == 35.0) {
            amount = 40.0;
        } else if (amount == 45.0) {
            amount = 50.0;
        }
    }



Re: weapon-config.inc - Damage system with many features - Jeroen52 - 13.07.2015

Код:
	new avg_rate = AverageShootRate(issuerid, 2);

	// Lower rapid fire damage
	if (avg_rate != -1) {
		if (weapon == WEAPON_DEAGLE && avg_rate < 500) {
			amount /= 1.4;
		} else if (weapon == WEAPON_SHOTGSPA && avg_rate < 250) {
			amount /= 1.4;
		}
	}
So using this you are punishing players for shooting very fast or c-bugging?

Also, I have noticed when you shoot a car without a driver and it explodes, when you leave the area and come back it will explode again.


Re: weapon-config.inc - Damage system with many features - Slice - 13.07.2015

It's not really punishment.. I'm just making rapid fire less powerful. It balances out very well. Someone who can't rapid fire has a chance against someone that's rapid firing.


Re: weapon-config.inc - Damage system with many features - TheRaGeLord - 30.07.2015

Amazin'


Re: weapon-config.inc - Damage system with many features - MasonSFW - 30.07.2015

Can anyone give me link download plugin windows .dll for 0.3.7-R2 ?


Re: weapon-config.inc - Damage system with many features - Jeroen52 - 01.08.2015

I have a problem where in certain situations, whenever you are on a bike and getting kicked, punched, or just falling off the bike at a high speed, you'll die instantly.
Even if the bike is stationary and you are getting punched off by carjacking there is a chance you'll instantly die because of a collision.


Re: weapon-config.inc - Damage system with many features - Slice - 01.08.2015

Disable the custom damage system.


Re: weapon-config.inc - Damage system with many features - Jeroen52 - 01.08.2015

Quote:
Originally Posted by Slice
Посмотреть сообщение
Disable the custom damage system.
Do you mean the custom falling damage? Because that is disabled already.


Re: weapon-config.inc - Damage system with many features - Slice - 01.08.2015

Can you easily reproduce this?


Re: weapon-config.inc - Damage system with many features - Jeroen52 - 01.08.2015

Quote:
Originally Posted by Slice
Посмотреть сообщение
Can you easily reproduce this?
It is quite easy, I don't know what the precise conditions are that causes the player to die, but carjacking a person on an NRG kills them.
I have tested it on a PCJ and it doesn't seem to kill.


Re: weapon-config.inc - Damage system with many features - Slice - 01.08.2015

Do you see anything in the server log? Could you enable debug logging?


Re: weapon-config.inc - Damage system with many features - Jeroen52 - 02.08.2015

Quote:
Originally Posted by Slice
Посмотреть сообщение
Do you see anything in the server log? Could you enable debug logging?
I have checked the logs after I died, nothing appeared.
I'm not sure how to debug this issue.


Re: weapon-config.inc - Damage system with many features - Crayder - 02.08.2015

Quote:
Originally Posted by Jeroen52
Посмотреть сообщение
I have checked the logs after I died, nothing appeared.
I'm not sure how to debug this issue.
First, do:
pawn Код:
//before including weap conf
#define WC_DEBUG



Re: weapon-config.inc - Damage system with many features - RogerCosta - 09.09.2015

JustMe.77, error continue

*Sorry for my bad english, please.


AW: Re: weapon-config.inc - Damage system with many features - JustMe.77 - 09.09.2015

Quote:
Originally Posted by RogerCosta
View Post
JustMe.77, error continue

*Sorry for my bad english, please.
What about this?

#include <weapon-config>
#include <a_samp>
#include <SKY>
#include <foreach>
#include <zcmd>
#include <sscanf2>
#include <SII>
#include <cpstream>