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 - Slice - 19.02.2015

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: 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;
}



Re: weapon-config.inc - Damage system with many features - Lorenc_ - 22.02.2015

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.


Re: weapon-config.inc - Damage system with many features - nickdodd25 - 22.02.2015

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.


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

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.


Re: weapon-config.inc - Damage system with many features - Tamer - 23.03.2015

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.


Re: weapon-config.inc - Damage system with many features - Tamer - 24.03.2015

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.


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

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.


Re: weapon-config.inc - Damage system with many features - rickisme - 28.03.2015

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



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

The problem is in your gamemode:
Quote:

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




Re: weapon-config.inc - Damage system with many features - KubiPL - 29.03.2015

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


Re: weapon-config.inc - Damage system with many features - vermaritt - 29.03.2015

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


Re: weapon-config.inc - Damage system with many features - KubiPL - 29.03.2015

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.


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

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


Re: weapon-config.inc - Damage system with many features - KubiPL - 29.03.2015

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.


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

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

This can only be done inside or after OnPlayerDeathFinished.


Re: weapon-config.inc - Damage system with many features - CoachCarter - 29.03.2015

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


Re: weapon-config.inc - Damage system with many features - rickisme - 29.03.2015

This include isn't support 0.3.7 RC right ?

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


Re: weapon-config.inc - Damage system with many features - Tamer - 29.03.2015

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.


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

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.


Re: weapon-config.inc - Damage system with many features - KubiPL - 04.04.2015

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.