AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [:3] TF2_CTFWeaponInfo (https://forums.alliedmods.net/showthread.php?t=136837)

Tauphi 09-15-2010 09:18

Re: [:3] TF2_CTFWeaponInfo
 
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" ?

Wazz 09-15-2010 09:22

Re: [:3] TF2_CTFWeaponInfo
 
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.

Tauphi 09-15-2010 09:41

Re: [:3] TF2_CTFWeaponInfo
 
puh ... do you have a small pseudo code example ? :D

Wazz 09-15-2010 09:58

Re: [:3] TF2_CTFWeaponInfo
 
Should get you started: http://wazz.ampaste.net/d61226c77

Tauphi 09-15-2010 11:59

Re: [:3] TF2_CTFWeaponInfo
 
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?

Wazz 09-15-2010 12:01

Re: [:3] TF2_CTFWeaponInfo
 
Use http://wazz.ampaste.net/d2b6e9bf0 EDIT: Forums still failing me.

Tauphi 09-16-2010 03:02

Re: [:3] TF2_CTFWeaponInfo
 
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?

Seta00 09-16-2010 06:44

Re: [:3] TF2_CTFWeaponInfo
 
Quote:

Originally Posted by Tauphi (Post 1300627)
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.

Wazz 09-16-2010 12:20

Re: [:3] TF2_CTFWeaponInfo
 
Or just dont use GetOwnerEntity()

CrancK 10-03-2010 04:51

Re: [:3] TF2_CTFWeaponInfo
 
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?)


All times are GMT -4. The time now is 18:14.

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