Raised This Month: $ Target: $400
 0% 

[:3] TF2_CTFWeaponInfo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 09-15-2010 , 09:18   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #1

Thx it's working now and another question ...

is there any way to get the owner/carrier client index of a CTFWeaponInfo object?
for example that i could say "all weapons used by bots should fire rockets with minigun" ?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 09-15-2010 , 09:22   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #2

The this pointer of a CTFWeaponBase detour will give you an CTFWeaponBase object that inherits from CBaseEntity. The object represents the actual weapon in the world. Then you can look up m_hOwner (or m_hOwnerEntity, I forget the property name) to get the entity of the player that owns the weapon.
Wazz is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 09-15-2010 , 09:41   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #3

puh ... do you have a small pseudo code example ?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 09-15-2010 , 09:58   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #4

Should get you started: http://wazz.ampaste.net/d61226c77
Wazz is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 09-15-2010 , 11:59   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #5

interesting .... but i wonder. when i use this one:
PHP Code:
CBaseEntity *pOwner pWeapon->GetOwnerEntity(); 
I get the error, that GetOwnerEntity is unknown. That comes, because I only have a declaration of CBaseEntity in the IGameHelpers.h.

Do you have a class/struct or whatever of CBaseEntity, that you are able to call function on those objects?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 09-15-2010 , 12:01   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #6

Use http://wazz.ampaste.net/d2b6e9bf0 EDIT: Forums still failing me.
Wazz is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 09-16-2010 , 03:02   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #7

thanks a lot ... worked, too ... but now i get this error when i try to compile:
PHP Code:
1>extension.obj error LNK2001unresolved external symbol "class CBaseEntityList * g_pEntityList" (?g_pEntityList@@3PAVCBaseEntityList@@A)
1>fatal error LNK11201 unresolved externals 
do you know how to solve this?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 09-16-2010 , 06:44   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #8

Quote:
Originally Posted by Tauphi View Post
thanks a lot ... worked, too ... but now i get this error when i try to compile:
PHP Code:
1>extension.obj error LNK2001unresolved external symbol "class CBaseEntityList * g_pEntityList" (?g_pEntityList@@3PAVCBaseEntityList@@A)
1>fatal error LNK11201 unresolved externals 
do you know how to solve this?
You're not linking properly to HL2SDK.
http://wiki.alliedmods.net/Writing_e...ons#Link_Paths

And don't forget to #define GAME_DLL 1 before including.
Seta00 is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 10-16-2010 , 06:46   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #9

Quote:
Originally Posted by Tauphi View Post
thanks a lot ... worked, too ... but now i get this error when i try to compile:
PHP Code:
1>extension.obj error LNK2001unresolved external symbol "class CBaseEntityList * g_pEntityList" (?g_pEntityList@@3PAVCBaseEntityList@@A)
1>fatal error LNK11201 unresolved externals 
do you know how to solve this?
Quote:
Originally Posted by Seta00 View Post
You're not linking properly to HL2SDK.
http://wiki.alliedmods.net/Writing_e...ons#Link_Paths

And don't forget to #define GAME_DLL 1 before including.
I am still unable to compile it. I tried to add all .lib files in my project. I tried it with the lib files from the default SDK, from the sourcemod SDKs.

added them in Project Properties -> Linker -> Input -> Additional Dependencies

and

Project Properties -> VC++ Directories -> Library Directories

Could you show me your VS link path configuration?
Or do I need a special .lib file or so which doesnt exist by default?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Swixel
Senior Member
Join Date: Jul 2010
Location: Sydney, Australia
Old 10-16-2010 , 18:44   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #10

There are a couple of issues with this code and it's unlikely the detours will work from what Wazz said alone (when I say unlikely, I mean I haven't managed to make it work, even with asherkin's help).

I integrated the structures/classes into my code some time ago ...

From VS2010
C++ -> Additional Includes
Code:
..;..\sdk;..\..\..\public;..\..\..\public\extensions;..\..\..\public\sourcepawn;$(SOURCEMOD13)\public;$(HL2SDKOBVALVE);$(HL2SDKOBVALVE)\public;$(HL2SDKOBVALVE)\public\engine;$(HL2SDKOBVALVE)\public\game\server;$(HL2SDKOBVALVE)\public\tier0;$(HL2SDKOBVALVE)\public\tier1;$(MMSOURCE17)\core;$(MMSOURCE17)\public;$(MMSOURCE17)\core\sourcehook;%(AdditionalIncludeDirectories)
Linker -> Input
Code:
$(HL2SDKOBVALVE)\lib\public\tier0.lib;$(HL2SDKOBVALVE)\lib\public\tier1.lib;%(AdditionalDependencies)
Swixel is offline
Reply



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 18:14.


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