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

[:3] TF2_CTFWeaponInfo


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

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 #12

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 #13

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 #14

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 #15

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 #16

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 #17

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 #18

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
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 09-16-2010 , 12:20   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #19

Or just dont use GetOwnerEntity()
Wazz is offline
CrancK
Senior Member
Join Date: Jan 2009
Location: Netherlands
Old 10-03-2010 , 04:51   Re: [:3] TF2_CTFWeaponInfo
Reply With Quote #20

how do i use this in/for a plugin?

like, add everything before the CON_COMMAND and then make my own CON_COMMAND? (it simply looks completely different from the sourcepawn i've been using, so it looks quite confusing to me) is it possible to explain it somewhat, so i could understand and adapt it myself?

from what i can gather, the stuff within the #ifdef _win32 to #endif is for signature finding, so i'd need to put that in my con cmd too.
then there's a check for the number of args, after which it converts the arg to a char? (is that simply a string? or actually just 1 character?), which is then used to find which effect? (with a check to see if name is invalid)
and then followed by the actual stuff that does something i think...
(do i remember correctly if -> has something to do with pointers?)

basically i'm looking for a way to up a player's weapondamage in tf2 (not everyone with that weapon btw), the problem in tf2 is that in the ctx, there is a max damage defined so even if i use a point hurt, i can't actually damage them with more then the max damage for that weapon at the same time. (i'd need multiple different point hurts, which if they kill someone spams loads of kill messages)

so ye... could you explain a bit? or provide a small example of what i'm wanting to try? (or even tell me this isn't the way to do it, cos you know a better way?)
CrancK 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 19:43.


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