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-07-2007 22:20

Team Question
 
Okay, I've been digging around in the SDK for the last few days and here's what I'm doing.

I'm working on a function in which I need to loop through each team for CS:S. In it I need to be able to access the team score, players, and the score for each player.

I know I need to use c_team.h, however, doing so requires including half of the sdk for what should be a relatively simple plugin.

Any suggestions on where to start?

Thanks
Aidan

BAILOPAN 07-07-2007 23:14

Re: Team Question
 
c_ means "client-side" in Valvespeak. are you developing a server-side modification?

Aidan 07-07-2007 23:26

Re: Team Question
 
Quote:

Originally Posted by BAILOPAN (Post 500331)
c_ means "client-side" in Valvespeak. are you developing a server-side modification?

I'm developing a plugin to tag onto metamod for a sophisticated team balance.

BAILOPAN 07-07-2007 23:53

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

Aidan 07-08-2007 00:00

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.


So where would I look to find the actual team data being stored by the server?

For example:

team[2]->score

That's more where I'm looking. I did take a look at those two articles and they both have a lot of useful information that I'll be needing later on.

My biggest problem atm is I can't find anything in the SDK because everything is spread out among the entire thing.

Sorry for all the questions.

-Aidan

BAILOPAN 07-08-2007 00:52

Re: Team Question
 
Look near/at the CCSTeam entity layout. There is a networkable entity for each team and they help propagate information to clients.

Once you get the CBaseEntity * pointer for one of the team entities, it's just a matter of using the offsets properly to peek at the private data.

Aidan 07-08-2007 11:06

Re: Team Question
 
Okay, I found the CBaseEntity in baseentity.h and added that in.

Is the networkable entity g_TeamData or whatnot?

Again, sorry for all the questions, I do know how to code, just not familiar with this SDK and there isn't any documentation on the data I'm trying to access anywhere that I can find.

BAILOPAN 07-08-2007 14:46

Re: Team Question
 
You can't access any of the mod's data reliably against the SDK. Addresses/signatures/orders change. That's why said article exists, because the most common way to do things is using the network property tables.

If you're on Linux you can probably get away with accessing global variables and such (because the binaries have symbols in tact and ELF late-resolves), but there's no guarantee that accessing their members or functions against the SDK will work as expected (if at all).

Aidan 07-08-2007 16:19

Re: Team Question
 
Quote:

Originally Posted by BAILOPAN (Post 500680)
You can't access any of the mod's data reliably against the SDK. Addresses/signatures/orders change. That's why said article exists, because the most common way to do things is using the network property tables.

If you're on Linux you can probably get away with accessing global variables and such (because the binaries have symbols in tact and ELF late-resolves), but there's no guarantee that accessing their members or functions against the SDK will work as expected (if at all).


Not on Linux unfortuantely, its a Windows server.

Aidan 07-08-2007 23:52

Re: Team Question
 
Okay, so I did a lot more reading today and I found out I need to #include <cbase.h>, because I need to use the entities held within that.

However -- when I include that file, I get about 400 errors.

Can anyone offer any suggestions on what to do to get it working?

Thanks,
Rob


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

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