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

Yeah I should change the documentation about the inclusion. I think the only part of YSI you need to include before is y_hooks - including some other parts might cause undefined behavior, since YSI wouldn't get data from the hooked natives.
The reason YSI cause errors is I don't forward OnPlayerGive/TakeDamage so people will not use them. I realize now I could do that in a very clever way by allowing only YSI to hook the callback.

As discussed, the custom fall damage is work in progress and should be considered experimental.

The last few days and coming couple of weeks are very busy for me. I'll try to test and merge your pull request soon.

Development of this have not stopped, just paused, as I've been too busy. Here are some things that are planned:
  • Improved custom fall damage. Water splash damage, falling out of or jumping off vehicles.
  • Customize weapon stunning. Make sniper stunning server-side synced to get rid of player warping and anti-stun cheats.
  • Make it possible to slow down passenger-DB (would be really nice for deagle, for example)
  • Add the same damage customizing to vehicle (vehicle health hacks will be impossible)
  • Improve vehicle ram damage (fix instant-death bug and make the damage based on speed)
In the mean time, here's another cool thing you can do (untested):
pawn Код:
public OnPlayerDamage(playerid, &Float:amount, &issuerid, &weapon, &bodypart) {
    // make ram damage based on how fast you're going
    if (weapon == WEAPON_VEHICLE && issuerid != INVALID_PLAYER_ID) {
        new Float:vx, Float:vy, Float:vz;
        GetVehicleVelocity(GetPlayerVehicleID(issuerid), vx, vy, vz);
        amount = 30.0 *(vx*vx+vy*vy+vz*vz);
    }

    return 1;
}
Reply
#42

This is fucking excellent. Well done Slice!

Comes to prove nothing is impossible, especially given that you managed to fix the knife sync issue!

I have an identical system, but it's pretty sloppy compared to this. I'll throw this on our servers sometime during the week! Cheers.
Reply
#43

Not sure if its a bug related to this or the SKY plugin, but for some reason occasionally if a player blows up in a vehicle, the killerid under onplayerdeath is the same as the playerid. For example my death list says "nickdodd25 killed nickdodd25".

Unfortunately i had the debug mode disabled for this and i cant seem to replicate it now.

Also with weapon-configs debug disabled, and SKY i'm getting a random debug message on linux. Kinda spams the log quite a bit.
Код:
[16:15:43] [ws] 0 63
[16:15:44] [ws] 0 63
[16:15:44] [ws] 0 63
[16:15:45] [ws] 0 63
[16:15:45] [ws] 0 63
[16:15:46] [ws] 0 63
[16:15:47] [ws] 0 63
[16:15:49] [ws] 0 63
[16:15:49] [ws] 0 63
[16:15:50] [ws] 0 63
[16:15:50] [ws] 0 63
[16:15:51] [ws] 0 63
[16:15:51] [ws] 0 63
[16:15:52] [ws] 0 63
[16:15:52] [ws] 0 63
[16:15:53] [ws] 0 3
[16:15:53] [ws] 0 20
[16:15:54] [ws] 0 12
[16:15:54] [ws] 0 10
[16:15:55] [ws] 0 16
[16:15:55] [ws] 0 3
[16:15:56] [ws] 0 18
[16:15:56] [ws] 0 0
I don't get this on windows and i didn't get it before i installed this.

Other than that this is a pretty badass system, works quite well! Can't wait for future updates and features.
Reply
#44

Quote:
Originally Posted by nickdodd25
Посмотреть сообщение
Not sure if its a bug related to this or the SKY plugin, but for some reason occasionally if a player blows up in a vehicle, the killerid under onplayerdeath is the same as the playerid. For example my death list says "nickdodd25 killed nickdodd25".
I can't find any strings containing '[ws]' in the sky source or weapcfg.
Reply
#45

Quote:
Originally Posted by Slice
View Post
You can see all the functions available here: https://github.com/oscar-broman/samp...nfig#functions
Ah fu how did I miss that. I'll check the documentation further.
Reply
#46

Is there a way to disable the custom death anims?

I noticed after spectating or sometimes death, you die and respawn at the place you died, then die again and respawn at your usual spawn point. (And this also happens sometimes at usual deaths)

If you set a player's position up high at a position (Setting a player's Z point high above) and watching them fall, they don't lose damage.

Does that-sync related function actually fix desync issues? (SetDisableSyncBugs) We intentionally tried to desync my friend (not through knife bug) and he didn't get desynced even with getting 600+ ping. He usually got desynced when he did this.
Reply
#47

Quote:

Is there a way to disable the custom death anims?

No. Feel free to add that and submit a pull request if you want that.

Quote:

I noticed after spectating or sometimes death, you die and respawn at the place you died, then die again and respawn at your usual spawn point. (And this also happens sometimes at usual deaths)

Check GitHub for similar problems, create an issue if you don't find one.

Quote:

If you set a player's position up high at a position (Setting a player's Z point high above) and watching them fall, they don't lose damage.

Use the default fall damage system until the custom one is improved.

Quote:

Does that-sync related function actually fix desync issues? (SetDisableSyncBugs) We intentionally tried to desync my friend (not through knife bug) and he didn't get desynced even with getting 600+ ping. He usually got desynced when he did this.

It doesn't fix all sync bugs in some magic way. It's a way to toggle some features in SKY. The things it will disable is mostly slide bugs (not the normal slide bug) and infinite shooting. It's more useful for servers without lagcomp.
Reply
#48

i got this when type exit on server console :

pawn Code:
[22:23:21] [debug] Server crashed while executing new.amx
[22:23:21] [debug] AMX backtrace:
[22:23:21] [debug] #0 native fread () from samp-server.exe
[22:23:21] [debug] #1 000543d8 in public WC_OnGameModeExit () at E:\work\rgame40\gamemodes\new.pwn:398
[22:23:21] [debug] #2 0002b0f4 in ?? () at E:\work\rgame40\Pawno\include\weapon-config.inc:1790
[22:23:21] [debug] #3 0000e970 in public ScriptInit_OnGameModeExit () at E:\work\rgame40\Pawno\include\YSI\y_hooks/impl.inc:516
[22:23:21] [debug] #4 000070b4 in public OnGameModeExit () at E:\work\rgame40\Pawno\include\YSI\internal\..\y_scriptinit.inc:269
[22:23:21] [debug] Native backtrace:
[22:23:21] [debug] #0 77acea02 in ?? () from C:\Windows\SYSTEM32\ntdll.dll
[22:23:21] [debug] #1 004943b0 in ?? () from samp-server.exe
[22:23:21] [debug] #2 004949e0 in ?? () from samp-server.exe
[22:23:21] [debug] #3 00404f14 in ?? () from samp-server.exe
Reply
#49

The problem is in your gamemode:
Quote:

E:\work\rgame40\gamemodes\new.pwn:398

Reply
#50

Please make ability to set respawn time greather than 5 secounds.
Reply
#51

To KubiPL, There is already a function for this, "SetRespawnTime(ms)".
Reply
#52

As I did, I've changed respawn time in preparedeath callback, but player respawns immediately.
Also there is in code default respawn time which is 6s set in OnPlayerDeath hook.
Did anyone tried set the respawn time in OnPrepareDeath greater than 6s?

//Edit: My bad, I was setting the respawn time in seconds but its ms.
Reply
#53

Also, if you return 0 in OnPlayerDeathFinished, the player will keep lying down on the ground.
Reply
#54

How about stopping player active death? When player is lying on the ground for the next 1 min and I want to get him up. Doing it without spawning player, but only with giving him back some health, and applying get up animation, like this.
Reply
#55

You can just use ApplyAnimation with like "PED" and "GETUP_front", or ClearAnimations.

This can only be done inside or after OnPlayerDeathFinished.
Reply
#56

Handy thing for Roleplay servers. AWESOME WORK !! Looking forward of seeing your new scripts ...
Reply
#57

This include isn't support 0.3.7 RC right ?

I'm using 0.3.7 RC-3, health bar, nerver update
Reply
#58

Quote:
Originally Posted by rickisme
Посмотреть сообщение
This include isn't support 0.3.7 RC right ?

I'm using 0.3.7 RC-3, health bar, nerver update
There's an RC1 version.
Reply
#59

Quote:
Originally Posted by rickisme
Посмотреть сообщение
This include isn't support 0.3.7 RC right ?

I'm using 0.3.7 RC-3, health bar, nerver update
It's not the include, it's SKY. SKY doesn't set textdraw positions in 0.3.7 yet so you'll probably need to wait until 0.3.7 is released for a real fix. If you want a minor fix (and it does work), pm me.
Reply
#60

There is a bug. When you're death and you press enter vehicle key near vehicle, your death is aborted.Animations get cleared and you can move while in dying state.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)