I was running an 8 player server.

The following code fixed my problem:

            pEnemyBaseEntity = CBaseEntity::Instance(pPlayerEdict);//
get the player entity

            // Check if its a player. (thx botman for pointing me out on
this <shame>)
            if (!pEnemyBaseEntity->IsPlayer())
                continue;

Thx ;) Now on with the ray casting, because sometimes it seems to go
straight through a box or something...

===============================================
Stefan Hendriks
FunDynamic & RealBot
http://www.fundynamic.nl
http://realbot.bots-united.com
http://www.bots-united.com

===============================================

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens jeff broome
Verzonden: dinsdag 11 januari 2005 15:36
Aan: hlcoders@list.valvesoftware.com
Onderwerp: Re: [hlcoders] PlayerInfoManager Interface?


> But, when i try to loop through the available players, i seem to get
> an error at in this code:
>         for ( int i = 1; i <= 32; i++ )  // EVIL: shouldn't just
> assume maxplayers is 32!!!
>         {
>                 edict_t *pPlayerEdict = INDEXENT( i );
>
>         if (pPlayerEdict)   // valid edict
>         {

<snip>

>                 // Set team (in case the game dll changed it for us)
>                 int iTeam = pInfo->GetTeamIndex(); //// *CRASH * *
> CRASH

Are you running a 32 player server?  If not, (say you're running an 8
player server), entities 9-32 will NOT be players, but you are treating
them as they are by trying to get the player info on them. You should
add a check to make sure entity X is actually a player (not the "EVIL"
part in the comment from my original code!!!)

Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders





_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to