joaquimandrade / Hamsandwich-Update

Updating and fixing hamsandwich for the good of mankind (or at least some part of it)
5 stars 5 forks source link

Ham_TakeHealth - Crashing. #6

Closed Wolftein closed 11 years ago

Wolftein commented 11 years ago

Using Sven Co-op 4.7.

RegisterHam(Ham_TakeHealth, "player", "hookTakeHealth");

public hookTakeHealth(id, Float:health, bits) { log_amx("hookTakeHealth %f", health); return HAM_HANDLED; // Crash. }

Arkshine commented 11 years ago

Thanks for reporting.

After checking fastly, it would seen this function takes 3 arguments instead of 2 for player entities.

Will have to create a new constant Ham_SC_TakeHealth.

Arkshine commented 11 years ago

@Wolftein : do you need I prepare new binaries or you can do it yourself ?

Wolftein commented 11 years ago

Yes please, could you add how to compile it from source? so i would not ask it again :D.

Any chance to add RegisterHam(..., "creatures or *", ....) ? (I'm doing a rpg plugin, and will be usefull to hook every entity's death to give experience to the attacker). (Sven Coop).

Thanks for fixing!.

Arkshine commented 11 years ago

About compiling, it would be more appropriate to ask on the AMXX forum.

About the feature asked, not sure. I understand the usefulness (event though it can be done easily without). But my priority for now is to check issues like this one and such, if we want the update be integrated in the official release. There is something else also you could do if you want, testing as svencoop functions you can, then reporting. It will help greatly. I don't know about this feature atm, but you should make a separate issue for it, to not forget.

About new binaries, will update my post on the AMXX forum today.

Closing for now.

Arkshine commented 11 years ago

Actually I would prefer you test before to confirm it works. Check this package. As note, hamdata.ini and ham_const.inc have been changed too. Make sure to stop your server, before updating all files, and don't forget to recompile your plugin using Ham_SC_TakeHealth.

Wolftein commented 11 years ago

I will try to test it as soon as i can!. About the feature, you're right, there is a way without need to add that! :D, thanks!. If i found any other issue i'll report it.

Wolftein commented 11 years ago

I´m getting this now using "RegisterHam(Ham_SC_TakeHealth, "player", "hookTakeHealth", 1);"

L 05/03/2013 - 20:00:39: [AMXX] Plugin says: Function out of bounds. Got: 406 Max: 405 L 05/03/2013 - 20:00:39: [AMXX] Run time error 1 (plugin "scxpm.amxx") - forced exit

Arkshine commented 11 years ago

As said, did you use the updated ham_const.ini file ?

EDIT: Oops, forgot to update one file. :P

Arkshine commented 11 years ago

Make sure to redownload the package; stop your server, overwrite .dll or .so file, and try again.

Wolftein commented 11 years ago

Working :)