AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Team Question (https://forums.alliedmods.net/showthread.php?t=57601)

Aidan 07-09-2007 18:23

Re: Team Question
 
L. Duke,

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

Thanks again for all of the help.

Aidan 07-09-2007 18:42

Re: Team Question
 
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 07-09-2007 20:44

Re: Team Question
 
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.

BAILOPAN 07-09-2007 21:31

Re: Team Question
 
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

Aidan 07-09-2007 21:54

Re: Team Question
 
Quote:

Originally Posted by BAILOPAN (Post 501287)
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 07-10-2007 10:32

Re: Team Question
 
Quote:

Originally Posted by BAILOPAN (Post 500376)
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

BAILOPAN 07-10-2007 15:27

Re: Team Question
 
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.

Aidan 07-11-2007 10:06

Re: Team Question
 
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

BAILOPAN 07-11-2007 10:55

Re: Team Question
 
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.

Aidan 07-11-2007 12:50

Re: Team Question
 
Quote:

Originally Posted by BAILOPAN (Post 502060)
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


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

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