Re: Team Question
In my opinion you shouldn't use cbase.h, if you MUST use it (you don't, trust me), do:
Code:
#define GAME_DLL 1 |
Re: Team Question
If you need to include cbase you're probably already going in the wrong direction.
|
Re: Team Question
Quote:
Okay, so now that I'm good and lost.... Here's what I'm trying to do. CTeam *t, *ct; t = CBasePlayer->GetTeam( ); ct = CBasePlayer2->GetTeam( ); int score[2]; score[0] = t->GetScore( ); score[1] = ct->GetScore( ); Anyone have any suggestions on where to start since I'm going the wrong way? (The code above is very rough and in no way comparable to what I'm writing, its just an example.) |
Re: Team Question
We're going in circles here... including this post I've now made 4 total that tell you to use network properties. You simply can't do normal calls against the SDK since CS:S changes class layouts.
Recap: All you need is a few CBaseEntity pointers and you can grab everything you need from network props. A network property is a named offset from the CBaseEntity pointer, i.e. grabbing an int looks like: Code:
int val = *(int *)((char *)pEntity + offset); 2) Loop through all entities and find one that a) Has a "CCSTeam" network class and b) Has an "m_iTeamNum" property value that matches the number 3) Get the "m_iScore" property of that CCSTeam entity |
Re: Team Question
Here's some example code of how I do it.
In ServerActivate I find the team pointers and save them for later use: Code:
// find team entities and store in teamT and teamCT pointers Code:
int DBUtils::GetTeamScore(edict_t *team) Code:
// find an offset for PropertyName listed in the server class send table for ClassName |
Re: Team Question
Thanks Bailopan and L. Duke. I just got some free time so I'm going to work on that now.
Bailopan, my apologies for the misunderstanding. I am still trying to learn the SDK and its not the easiest thing to work with. I wasn't trying to be an ignorant pain. :) I'll let you all know how it goes. Thanks! -Rob |
Re: Team Question
Quote:
Can I ask where pEdictList comes from? I can't find anything in what I have that says where it is. All I can find is ServerActivate(edict_t *pEdictList), yet nothing defines what it is. Thanks Rob |
Re: Team Question
That's exactly where it comes from. It's just the list of edicts. You can get the same thing by looping through engine->PEntityOfEntIndex(i) up to the maximum number of entities.
|
Re: Team Question
Quote:
|
Re: Team Question
durh, i'm an idiot. I just figured out what I did wrong. -.-
|
All times are GMT -4. The time now is 15:02. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.