Raised This Month: $51 Target: $400
 12% 

Team Question


Post New Thread Reply   
 
Thread Tools Display Modes
Aidan
Junior Member
Join Date: Jul 2007
Old 07-09-2007 , 18:23   Re: Team Question
Reply With Quote #21

L. Duke,

Could you show me how you've got your gDBUtils::GetTeamTeamNum(pEnt);
function written?

Thanks again for all of the help.
Aidan is offline
Aidan
Junior Member
Join Date: Jul 2007
Old 07-09-2007 , 18:42   Re: Team Question
Reply With Quote #22

Actually, I got it. Sorry about that.

Baltoa, thank you for the list you posted with the table dump in it. It was amazingly helpful.
Aidan is offline
Aidan
Junior Member
Join Date: Jul 2007
Old 07-09-2007 , 20:44   Re: Team Question
Reply With Quote #23

okay,

I have another, hopefully simple question now that I've figured the basics to this out.

Where is the player data stored?

ie player1->kills, player1->deaths

I found some in CBasePlayer, however, I'm sure thats not where I need to look and its not in the table http://www.bailopan.net/table_dump.txt that Bailopan gave me.

The only thing in there that I felt could be close was CPlayerResource using m_iScore and m_iDeaths, however, when I called that with the offset it didn't increment up with kills/deaths.

Sorry for all of the stupid questions.
Aidan is offline
BAILOPAN
Join Date: Jan 2004
Old 07-09-2007 , 21:31   Re: Team Question
Reply With Quote #24

m_iFrags and m_iDeaths as saverestore (datamap_t) properties instead of network (sendprop) properties. the article covers those too; lookup method is the only thing that changes.

it is safe to call CBaseEntity::GetDataDescMap() from almost all mods except The Ship because it's very low in the vtable ordering.

if you only need to get the information, you can use IPlayerInfoManager, because IPlayerInfo has GetPlayerFrags and GetPlayerDeaths
__________________
egg
BAILOPAN is offline
Aidan
Junior Member
Join Date: Jul 2007
Old 07-09-2007 , 21:54   Re: Team Question
Reply With Quote #25

Quote:
Originally Posted by BAILOPAN View Post
m_iFrags and m_iDeaths as saverestore (datamap_t) properties instead of network (sendprop) properties. the article covers those too; lookup method is the only thing that changes.

it is safe to call CBaseEntity::GetDataDescMap() from almost all mods except The Ship because it's very low in the vtable ordering.

if you only need to get the information, you can use IPlayerInfoManager, because IPlayerInfo has GetPlayerFrags and GetPlayerDeaths
Thanks a ton!
Aidan is offline
Aidan
Junior Member
Join Date: Jul 2007
Old 07-10-2007 , 10:32   Re: Team Question
Reply With Quote #26

Quote:
Originally Posted by BAILOPAN View Post
Then you're poking into the wrong areas. I would take a gander at this article: http://wiki.alliedmods.net/Entity_Properties

Then at this: http://wiki.alliedmods.net/Useful_Si...s_%28Source%29

The latter because you will need to call CCSPlayer::SwitchTeam() for good team balancing.

Bailopan,

Is the sig scanning available in metamod or is it sourcemod only?

Thanks
-Rob
Aidan is offline
BAILOPAN
Join Date: Jan 2004
Old 07-10-2007 , 15:27   Re: Team Question
Reply With Quote #27

Scanning memory is something you can do on any platform. SourceMod just has builtin helper functions for it, so you don't have to write your own code.
__________________
egg
BAILOPAN is offline
Aidan
Junior Member
Join Date: Jul 2007
Old 07-11-2007 , 10:06   Re: Team Question
Reply With Quote #28

Okie dokie, things work. Many many thanks to Bailopan and L. Duke for putting up with me and pointing me in the right direction.

I did have one last question though.

Using, IPlayerInfo *plr;

plr->ChangeTeam(newTeam);

That swaps the player to the opposite team and puts them in the menu to choose a model. Is there anyway I can simply change them to the opposite team and set their model to a default one so that it doesn't "slay" them and make them respawn without the things they'd already bought?

Thanks
Rob
Aidan is offline
BAILOPAN
Join Date: Jan 2004
Old 07-11-2007 , 10:55   Re: Team Question
Reply With Quote #29

CCSPlayer::SwitchTeam does that -- just know you will have to scan for its address since it's not a virtual function nor something easily exposed.
__________________
egg
BAILOPAN is offline
Aidan
Junior Member
Join Date: Jul 2007
Old 07-11-2007 , 12:50   Re: Team Question
Reply With Quote #30

Quote:
Originally Posted by BAILOPAN View Post
CCSPlayer::SwitchTeam does that -- just know you will have to scan for its address since it's not a virtual function nor something easily exposed.

Okay, I did a ServerClass scan for CCSPlayer and found it. I also managed to step through all of CCSPlayer's variable info, however, I'm a bit stuck as to what to do now.

Having found ServerClass *s as CCSPlayer, do I simply do
CCSPlayer *p = s; ?

Sorry for all of the questions, this stuffs just a bit confusing at first.

Thanks,
Rob
Aidan 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 07:19.


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