oscar-broman / samp-weapon-config

A more consistent and responsive damage system with many new features
Apache License 2.0
93 stars 83 forks source link

Few bugs #288

Closed PazzOnee closed 2 months ago

PazzOnee commented 2 months ago

When you shot someone, etc. Deagle, textdraw feed show's reason hit is multiple, but not, and when you kill him with gun, reason is -1, and OnPlayerDeath not calling because array index of bouds

[2024.05.16 - 06:31:34] [Info] [debug] Run time error 4: "Array index out of bounds" [2024.05.16 - 06:31:34] [Info] [debug] Attempted to read/write array element at negative index -1 [2024.05.16 - 06:31:34] [Info] [debug] AMX backtrace: [2024.05.16 - 06:31:34] [Info] [debug] #0 002c2a30 in public WC_OnPlayerDeath (0, 1, -1) in <unknown> [2024.05.16 - 06:31:34] [Info] [debug] #1 0002665c in ?? (0, 1089680176, 1, -1, 3, 0) in <unknown> [2024.05.16 - 06:31:34] [Info] [debug] #2 00017f28 in public OnPlayerGiveDamage (1, 0, 1111018701, 24, 3) in <unknown>

sa-mp-002

Second bug is that PlayerTextDrawSetString and TextDrawSetStringForPlayer for player can't use OPEN_MP_TAGS:..., instead of this, output will be %i, %s, %? on textdraw..

@NexiusTailer

NexiusTailer commented 2 months ago

When you shot someone, etc. Deagle, textdraw feed show's reason hit is multiple

When you shot someone e.g. deagle, textdraw feed shows deagle as a reason:

image

Multiple guns are shown only when you did damage from more than one weapon. I also don’t understand the connection between damage feed notification with weaponid as -1 ("Multiple") and calling OnPlayerDeath with the corrupted reason -1. s_DamageFeedHitsGiven and s_DamageFeedHitsTaken arrays aren't write it's data into anything else. So, you need to share more information of how to reproduce calling OnPlayerDeath with the invalid reason (and thus getting a runtime error)

Second bug is that PlayerTextDrawSetString and TextDrawSetStringForPlayer for player can't use OPEN_MP_TAGS:..., instead of this, output will be %i, %s, %? on textdraw..

It can, it just needs y_va to be included

PazzOnee commented 2 months ago

Just download latest open.mp RELEASE, al pawn.raknet, then include weapon-config and u will see that but, then warning 201: redefinition of constant/macro (symbol "WEAPON_UNKNOWN") when compile

I don't use anything from YSI, so i dont have y_va, and i dont want it, i just remove hook in weapon-config for (Player)TextdrawSetstring, and then work fine

@NexiusTailer

PazzOnee commented 2 months ago

I just test it with samp server version, its open.mp conflict, on samp all is okay @NexiusTailer

NexiusTailer commented 2 months ago

Just download latest open.mp RELEASE, al pawn.raknet, then include weapon-config and u will see that but, then warning 201: redefinition of constant/macro (symbol "WEAPON_UNKNOWN") when compile

It's not weapon-config fault. Read here: #278

I don't use anything from YSI, so i dont have y_va, and i dont want it, i just remove hook in weapon-config for (Player)TextdrawSetstring, and then work fine

Modifying includes is a bad practice, you shouldn't do that

NexiusTailer commented 2 months ago

I just test it with samp server version, its open.mp conflict

Which one? You've messed all your random questions into one issue so clarify please

PazzOnee commented 2 months ago

It's because duplicate definition UNKNOWN_WEAPON, so i redefined it to another macro in weapon config

NexiusTailer commented 2 months ago

It's because duplicate definition UNKNOWN_WEAPON, so i redefined it to another macro in weapon config

Yes, but it's not weapon-config issue