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

This is an include that provides a more consistent and responsive damage system with many new features.

It's pretty much plug-and-play if you don't have any filterscripts that interfere with the health or death events.

Demo server

Code:
HostName: Slice's test server
Address:  ulclan.com:1234
Players:  0 / 100
Ping:     42
Mode:     Slice's test gm
Map:      San Andreas
Features
  • Server-side health
    • Impossible to use health hacks on lagcomp mode
    • Any type of damage can be modified/prevented, even falling 1000m from the sky
    • Vending machines are controlled server-side (buildings removed and objects created)
    • Paused players can be killed (with death animations) and their HP bars always show the correct values
  • Destroy vehicles with a passenger but no driver
  • Custom falling damage (optional)
    • Adjust the damage and at which speed a player will die
  • Sounds and on-screen TextDraw indicators of damage given/taken
    • Also shows another player's damage feed when spectating
  • New weapon types detected:
    • WEAPON_PISTOLWHIP - When you punch someone with a gun
    • WEAPON_VEHICLE_M4 - Vehicles with M4 guns (e.g. Rustler)
    • WEAPON_VEHICLE_MINIGUN - Vehicles with miniguns (e.g. Hunter)
    • WEAPON_HELIBLADES - Helikill
    • WEAPON_CARPARK - When you park your car on someone
  • Extensive sanity checking on shots:
    • Modified weapon.dat is automatically detected
    • Shot vector, player distance, and much more is examined
    • A callback is invoked for each so-called "rejected hit" so that the player is informed. A few of these are:
      • Inflicting damage when already dead (due to lag)
      • Hit a player too far from the shot hit position (due to severe lag or cheating)
      • Hitting/shooting too fast (due to severe lag or cheating)
  • Modify every weapon's damage amount
    • To a single value
    • To multiple values depending on the shot distance
    • With custom logic in a callback, for example:
      • Increase damage for headshots
      • Increase/lower damage for combos
      • Lower damage for c-bug rapid fire
  • Knife sync fixed in both lagcomp and no-lagcomp
  • New death atnimations and respawn logic
    • Customize respawn time globally and for each death
    • Fully customizable animations, with a nice set of defaults
    • Different animation depending on weapon/bodypart, for example:
      • Headshots make you fall back with both hands in your face
      • Shotgun kills make you fly backward like in GTA:VC (unless killed from behind)
Download

GitHub: https://github.com/oscar-broman/samp-weapon-config
Reply
#2

Another Awesome Relases Of You,Slice!
Amazing work,Well done
Reply
#3

Second. Great release! Hopefully this will end the era of health hacking in SA-MP.
Reply
#4

Nice release, Slice. I like the anti hh. thanks
Reply
#5

Looks nice
Reply
#6

Nice... its gonna help a lot specially to tdm dm...and cnr..
Reply
#7

I like it.
Reply
#8

Great! Love it!
Reply
#9

That is some very complex, and lengthy code. How long did it take you to write the include?
Reply
#10

It took quite a while to develop, since I didn't stop until the animations looked perfect! Though I still have some more things I want to add.

Binaries will be officially released for SKY soon.

In the mean time, try this: http://server.ulclan.com/SKY.so
Reply
#11

The health bar bigger is because the knife bug?

Nice work dude!
Reply
#12

Using wide screen fix mod for gta sa will cause this:
Reply
#13

How exactly does wide screen need to be fixed?

Either way, is there a way to detect that mode by reading the camera mode or vectors?
Reply
#14

I don't think so, this is an old ASI mod for GTA.
Reply
#15

Quote:
Originally Posted by Slice
View Post
How exactly does wide screen need to be fixed?

Either way, is there a way to detect that mode by reading the camera mode or vectors?
GetPlayerCameraAspectRatio.

Will return 0.0000 for WIDESCREEN and 0.333333 for NON-WIDESCREEN.
Reply
#16

He's talking about some CLEO, which by the way makes you impossible to hit on non-lagcomp servers and fucks up rocket launcher shoot vectors.

I suppose the aspect ratio should be another value for it. Could someone look into that?
Reply
#17

1.776470 is returned when using this CLEO mod, you think perhaps you could modify the include to detect whether a player is using it or not?
Reply
#18

Since you create a custom bar, I think you could add a define for the color. Like WC_HEALTH_COLOR. By default it'd be the normal color.

Or, you could use this color array and set the bar to (floatround(health)-1).

pawn Code:
new RGY[100] =
{
    0xFF0000FF,0xFF0500FF,0xFF0A00FF,0xFF0F00FF,0xFF1400FF,0xFF1900FF,0xFF1E00FF,0xFF2300FF,0xFF2800FF,0xFF2D00FF,
    0xFF3300FF,0xFF3800FF,0xFF3D00FF,0xFF4200FF,0xFF4700FF,0xFF4C00FF,0xFF5100FF,0xFF5600FF,0xFF5B00FF,0xFF6000FF,
    0xFF6600FF,0xFF6B00FF,0xFF7000FF,0xFF7500FF,0xFF7A00FF,0xFF7F00FF,0xFF8400FF,0xFF8900FF,0xFF8E00FF,0xFF9300FF,
    0xFF9900FF,0xFF9E00FF,0xFFA300FF,0xFFA800FF,0xFFAD00FF,0xFFB200FF,0xFFB700FF,0xFFBC00FF,0xFFC100FF,0xFFC600FF,
    0xFFCC00FF,0xFFD100FF,0xFFD600FF,0xFFDB00FF,0xFFE000FF,0xFFE500FF,0xFFEA00FF,0xFFEF00FF,0xFFF400FF,0xFFF900FF,
    0xFFFF00FF,0xF9FF00FF,0xF4FF00FF,0xEFFF00FF,0xEAFF00FF,0xE4FF00FF,0xDFFF00FF,0xDAFF00FF,0xD5FF00FF,0xD0FF00FF,
    0xCAFF00FF,0xC5FF00FF,0xC0FF00FF,0xBBFF00FF,0xB6FF00FF,0xB0FF00FF,0xABFF00FF,0xA6FF00FF,0xA1FF00FF,0x9CFF00FF,
    0x96FF00FF,0x91FF00FF,0x8CFF00FF,0x87FF00FF,0x82FF00FF,0x7CFF00FF,0x77FF00FF,0x72FF00FF,0x6DFF00FF,0x68FF00FF,
    0x62FF00FF,0x5DFF00FF,0x58FF00FF,0x53FF00FF,0x4EFF00FF,0x48FF00FF,0x43FF00FF,0x3EFF00FF,0x39FF00FF,0x34FF00FF,
    0x2EFF00FF,0x29FF00FF,0x24FF00FF,0x1FFF00FF,0x1AFF00FF,0x14FF00FF,0x0FFF00FF,0x0AFF00FF,0x05FF00FF,0x00FF00FF
};
100 colors, fade from green to yellow to red.





Edit: My server keeps crashing, is it because it is 0.3.7? Also, the bar is pretty wide (tall).
Reply
#19

0.3.7 is not supported by SKY yet. I'll deal with it as fast as I can.

Could you attach gdb to the process and print a backtrace of the crash?
Reply
#20

Quote:
Originally Posted by Slice
View Post
0.3.7 is not supported by SKY yet. I'll deal with it as fast as I can.

Could you attach gdb to the process and print a backtrace of the crash?
It only crashes when I'm in game, and I can't connect to the server (or even query it) while gdb is attached. Lol, alternative?


EDIT: ALso, I can't run the server from the gdb console. It says server.cfg could not be run (and I get the intro stuff).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)