After several tries, I couldn't manage to nullify the damage with OnPlayerAttack...
hitinfo.damageTypes:Set( hitinfo.damageTypes:GetMajorityDamageType(), 0 ) doesn't work
hitinfo.damageTypes = new(Rust.DamageTypeList._type, nil) neither
Nullify damage with OnPlayerAttack
Discussion in 'Rust Development' started by TheRotAG, Feb 6, 2015.
-
Try setting the Hitinfo Weapon to null, the hook is called before the damage is determined on "OnPlayerAttack" so whatever you do with damagetypes, the attack stats (damageTypes) of the weapon are grabbed after the hook has run.
-
I'm using DILE (Dotnet IL Editor) to add the Assemblies to a blank project and read them. The problem is that I couldn't find things such as Hitinfo. Only DamageTypesList, and things like that. How can I read the publics like Hitinfo and others?
-
I'd recommend looking at JustDecompile (by Telerik) or another decompiler, it's going to be more useful to you than DILE.
-
-
It's a free one, and can be downloaded here: http://www.telerik.com/products/decompiler.aspx
-
Ok, using JustDecompile now. Right click on a DLL and it shows the samethings I saw on DILE.
What did I need to do to find Hitinfo in there? just as an example of course. -
You just navigate through the classes on the left and you get everything that belongs to the class on the right and there you can check the details of the methods and such. When it refers to another class you can just click it to get taken to that source.