[Include] weapon-config.inc - Damage system with many features

Quote:
Originally Posted by Slice
View Post
Enable debug and show me the output.
pawn Code:
#define WC_DEBUG true
#include <weapon-config>
Code:
[15:27:31] [connection] 127.0.0.1:49541 requests connection cookie.
[15:27:32] [connection] incoming connection: 127.0.0.1:49541 id: 0
[15:27:33] [join] Admin has joined the server (0:127.0.0.1)
(player spawned)
(player used /v hunter)
(player entered hunter, blew self up)
[15:27:56] (wc) OnPlayerDeath(0 died by 255 from 65535)
[15:27:56] (wc) OnPlayerDamageDone(65535 did 200.000000 to 0 with 51 on bodypart 0)
[15:27:59] (wc:0) Requested class: 0
[15:27:59] (wc:0) True death class selection
Reply

is it possible to hide health bar ?
Reply

Quote:
Originally Posted by ajwar
View Post
is it possible to hide health bar ?
Yeah, just remove it from the code...
Reply

Quote:
Originally Posted by ajwar
View Post
is it possible to hide health bar ?
No, not without modifying the include.

Quote:
Originally Posted by MartinSwag
View Post
Code:
[15:27:31] [connection] 127.0.0.1:49541 requests connection cookie.
[15:27:32] [connection] incoming connection: 127.0.0.1:49541 id: 0
[15:27:33] [join] Admin has joined the server (0:127.0.0.1)
(player spawned)
(player used /v hunter)
(player entered hunter, blew self up)
[15:27:56] (wc) OnPlayerDeath(0 died by 255 from 65535)
[15:27:56] (wc) OnPlayerDamageDone(65535 did 200.000000 to 0 with 51 on bodypart 0)
[15:27:59] (wc:0) Requested class: 0
[15:27:59] (wc:0) True death class selection
Do you ever use AddPlayerClass? Do you use weapon-config in a filterscript or the gamemode?
Reply

Quote:
Originally Posted by Slice
View Post
No, not without modifying the include.


Do you ever use AddPlayerClass? Do you use weapon-config in a filterscript or the gamemode?
I use AddPlayerClass once and I use the plugin in the gamemode and don't have any filterscripts.
Reply

1) is it possible to create cmd to remove healthbar ?

2) How to reduce damage for SPAZ ?

Tryed

pawn Code:
SetWeaponDamage(
        27,
        DAMAGE_TYPE_STATIC,
        13.5
    );
But with this code the damage was bigger. ~100hp single bullet.
Reply

I have noticed something with this include.
It works fine, However it messes up the team. If i included this on my script, the GetPlayerTeam doesn't work at all (I have coded an objective system which places their camera on their objective before letting them spawn.) If i included this, That system doesn't work at all. While if i removed this include, it works perfectly.

Any idea why? (My gamemode uses the SetPlayerTeam & GetPlayerTeam function)
Reply

Quote:
Originally Posted by QuaTTrO
View Post
Can this include prevent player cheating with god mode?
This makes health hacking impossible it simply wouldn't do anything any serious server owner knows that health hacking is a thing of the past.
Reply

Is there a way when damaging a player to take only the health if the player has armor?
Reply

@MarginSwag: Do you have auto-login? Does it spawn the player BEFORE OnPlayerRequestClass? In which case, you should spawn the player after OnPlayerRequestClass.
Also make sure you have the latest version of both include, server, and plugin.
What include files do you have, and in which order?

@Jeroen52: It's not possible, but you're welcome to add it and make a pull request. It should be quite simple. First add an optional argument in the end of DamagePlayer and InflictDamage, something like "bool:ignore_armour = false".

After that, edit https://github.com/oscar-broman/samp...nfig.inc#L4521 to check that argument.
Reply

Quote:
Originally Posted by Slice
View Post
@Jeroen52: It's not possible, but you're welcome to add it and make a pull request. It should be quite simple. First add an optional argument in the end of DamagePlayer and InflictDamage, something like "bool:ignore_armour = false".

After that, edit https://github.com/oscar-broman/samp...nfig.inc#L4521 to check that argument.
Thanks for pointing that out, I made something that works.
I might just make something like bool:ignore_armour = false to contribute something back.
Reply

Quote:
Originally Posted by Jeroen52
View Post
Thanks for pointing that out, I made something that works.
I might just make something like bool:ignore_armour = false to contribute something back.
(Jeroen has done this now, and it's in.)

I added an armour rule feature on to it (yes it's implemented).

Each weapon can now be set to either distribute damage between armour and health OR only apply damage to health. There is also a torso-only option. It can be used to limit armour protection to the torso for more realistic use (ex. a bullet to the arm shouldn't affect armour, but a bullet to the torso should).

Functions:

SetCustomArmourRules(bool:armour_rules, bool:torso_rules);
Toggle the custom armour rules on and off. Both are disabled by default.
  • armour_rules - Toggle all of the rules. When off, nothing is affected. Armour is affected as it normally would. When on, weapons can be set to either damage armour before health or just take health and never damage armour.
  • torso_rules - Toggle all torso-only rules. When off, all weapons will have effects no matter which bodypart is 'hit'. When on, weapons with the torso_only rule (of SetWeaponArmourRule) on will only damage armour when the torso is 'hit' (and when it's off, armour is damaged no matter which body part is 'hit').
SetWeaponArmourRule(weaponid, bool:affects_armour, bool:torso_only);
Set custom rules for a weapon. The defaults aren't going to comfort EVERYONE, so everyone needs the ability to modify the weapons themselves.
  • weaponid - The ID of the weapon to modify the rules of.
  • affects_armour - Whether this weapon will distribute damage over armour and health or just damage health directly.
  • torso_only - Whether this weapon will only damage armour when the 'hit' bodypart is the torso or all bodyparts. Only works when torso_rules are enabled using SetCustomArmourRules.
_______________________________________

Also, Y_Less has fed me a great suggestion (see the conversation here for more info) to further improve this. I'll be adding it when I have a bit of free time.
Reply

Quote:
Originally Posted by Crayder
View Post
(Jeroen has done this now, and it's in.)

I added an armour rule feature on to it (yes it's implemented).

Each weapon can now be set to either distribute damage between armour and health OR only apply damage to health. There is also a torso-only option. It can be used to limit armour protection to the torso for more realistic use (ex. a bullet to the arm shouldn't affect armour, but a bullet to the torso should).

Functions:

SetCustomArmourRules(bool:armour_rules, bool:torso_rules);
Toggle the custom armour rules on and off. Both are disabled by default.
  • armour_rules - Toggle all of the rules. When off, nothing is affected. Armour is affected as it normally would. When on, weapons can be set to either damage armour before health or just take health and never damage armour.
  • torso_rules - Toggle all torso-only rules. When off, all weapons will have effects no matter which bodypart is 'hit'. When on, weapons with the torso_only rule (of SetWeaponArmourRule) on will only damage armour when the torso is 'hit' (and when it's off, armour is damaged no matter which body part is 'hit').
SetWeaponArmourRule(weaponid, bool:affects_armour, bool:torso_only);
Set custom rules for a weapon. The defaults aren't going to comfort EVERYONE, so everyone needs the ability to modify the weapons themselves.
  • weaponid - The ID of the weapon to modify the rules of.
  • affects_armour - Whether this weapon will distribute damage over armour and health or just damage health directly.
  • torso_only - Whether this weapon will only damage armour when the 'hit' bodypart is the torso or all bodyparts. Only works when torso_rules are enabled using SetCustomArmourRules.
_______________________________________

Also, Y_Less has fed me a great suggestion (see the conversation here for more info) to further improve this. I'll be adding it when I have a bit of free time.
I'm just thinking about the things I can do with this, it all feels limitless.
Reply

how to set a player to godmode? setting the amount parameter to 0 in OnPlayerDamage doesn't work as I can see..
Reply

Quote:
Originally Posted by fordawinzz
View Post
how to set a player to godmode? setting the amount parameter to 0 in OnPlayerDamage doesn't work as I can see..
Try to return 0;
Reply

Yo, I've seen a few days before somewhere with which I can change the Healthbar Color, but I do not remember where exactly it was. Can anyone share it with me? And by the way, are we able to change the Armor Bar Color aswell?
Reply

Quote:
Originally Posted by JustMe.77
View Post
Yo, I've seen a few days before somewhere with which I can change the Healthbar Color, but I do not remember where exactly it was. Can anyone share it with me? And by the way, are we able to change the Armor Bar Color aswell?
https://github.com/oscar-broman/samp...nc#L3750#L3774
https://github.com/oscar-broman/samp...nfig.inc#L4008
Reply

You can change those or look at my pull request for extreme color options. Even gradients!
Reply

Did anyone make an .asi that would update the health bar for people with modded SA?
Reply

I don't understand how to set player godmode with included weapon-config
Reply


Forum Jump:


Users browsing this thread: 10 Guest(s)