Raised This Month: $32 Target: $400
 8% 

DHooks (Dynamic Hooks - Dev Preview)


Post New Thread Reply   
 
Thread Tools Display Modes
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 05-08-2015 , 12:07   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #271

Quote:
Originally Posted by lechoo View Post
I'm using the latest DHooks and 'Example/Test Plugin' from first post. The same problem like red4911. Any way to fix this?
Rename the "interface" and "this" variables to something else.
__________________

Last edited by GoD-Tony; 05-08-2015 at 12:08.
GoD-Tony is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-13-2015 , 08:15   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #272

Spoiler
I cant get DHookGetReturn to give me an entity index for GiveNamedItem's return type.

If I create a hook with the return type of ReturnType_Int it get this:
Code:
----------==========> MRESReturn:OnGiveNamedItem(client=3, entity=164975072)
----------==========> MRESReturn:OnGiveNamedItem(client=3, entity=177344800)
----------==========> MRESReturn:OnGiveNamedItem(client=3, entity=177231552)
----------==========> MRESReturn:OnGiveNamedItem(client=3, entity=164039216)
Which looks like a pointer to me. So I naturally try ReturnType_CBaseEntity which crashes the server

I think the return type is CBaseEntity*. Is there anyway way for me to convert this into a entity index?
__________________
Neuro Toxin is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 05-13-2015 , 08:59   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #273

It automatically returns you an index if you tell it its an entity (since sourcemod has no way of using CBaseEntity pointers). Not exactly sure why its crashing but you should make your returns all by value. Ive definetly hooked it before just fine, also second to last param should be marked as Unknown (unknown is simply internally any pointer) or you could use ObjectPtr (if you care to modify its data). Everything else looks right, ill have a better look later today
Dr!fter is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-13-2015 , 09:51   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #274

Shouldn't the third param be a HookParamType_ObjectPtr since it's a CEconItemView*?

Not sure if that would make a difference though.

Also, a stack trace would be handy as it'd tell us where the crash is.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-13-2015 at 09:53.
Powerlord is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 05-13-2015 , 10:55   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #275

Quote:
Originally Posted by Dr!fter View Post
second to last param should be marked as Unknown (unknown is simply internally any pointer) or you could use ObjectPtr (if you care to modify its data).
Quote:
Originally Posted by Powerlord View Post
Shouldn't the third param be a HookParamType_ObjectPtr since it's a CEconItemView*?

Not sure if that would make a difference though.

Also, a stack trace would be handy as it'd tell us where the crash is.
You could use either unknown or ObjectPtr they are both just void *, defining it as a ObjectPtr allows you to use the natives to set/get object members. I assume he doesnt care about reading it, so unknown is fine.

Last edited by Dr!fter; 05-13-2015 at 10:56.
Dr!fter is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-13-2015 , 15:09   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #276

Just an FYI, if you try to build this against SourceMod 1.8 (the current master branch) on Windows, it will error out with this message:

Code:
c:\Projects\SourceMod\dev\sourcemod\public\IShareSys.h(40) : fatal error C1083:
Cannot open include file: 'sp_vm_types.h': No such file or directory
Not sure if this is because sourcepawn is a submodule now or what.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-13-2015 at 15:12.
Powerlord is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 05-13-2015 , 15:23   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #277

Did you fetch said sourcepawn submodule?
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-13-2015 , 15:27   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #278

Quote:
Originally Posted by Dr. Greg House View Post
Did you fetch said sourcepawn submodule?
Yes. In fact, I went back and did a new clone with the recursive option set just to make sure.

There are 6 files and 10 8 subdirectories in the sourcemod\sourcepawn directory.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-13-2015 at 15:28. Reason: Why does windows include . and .. in the subdirectory count? This is why I use ls -lA on Linux.
Powerlord is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-13-2015 , 15:41   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #279

It's in sourcepawn/include now, instead of public/sourcepawn/ or wherever it was.
psychonic is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 05-13-2015 , 17:26   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #280

What I'm trying to do is post hook GiveNamedItem so I can grab the client and weapon indices. At the end of the day I'm updating netprops based on item definition index which needs to be done directly after the GiveNamedItem call.

Tbh. I don't care about any params at all. I only care about the return.

I'm running windows csgo (I'm sure u guys figured this out).

How do I generate a crashdump? I have to add something to my command line?
__________________
Neuro Toxin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode