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

Index of entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
3jorn
Junior Member
Join Date: May 2007
Old 08-06-2007 , 08:26   Index of entity
Reply With Quote #1

In this code;

Code:
for( int i=1; i<maxplayers; i++)
        {    
            bool bNeedsCorrigation = false;

            edict_t *pEntity = engine->PEntityOfEntIndex( i );
            if ( !pEntity || pEntity->IsFree( ) ) continue;

            IPlayerInfo *pInfo = playerinfomanager->GetPlayerInfo( pEntity );
            if ( !pInfo || !pInfo->IsConnected( ) || FStrEq(pInfo->GetNetworkIDString(),"BOT") ) continue;

            

            const char *name    = pInfo->GetName();
            int rate            = atoi( engine->GetClientConVarValue( engine->IndexOfEdict(pEntity), "rate" ) );
            int updaterate        = atoi( engine->GetClientConVarValue( engine->IndexOfEdict(pEntity), "cl_cmdrate" ) );
            int cmdrate            = atoi( engine->GetClientConVarValue( engine->IndexOfEdict(pEntity), "cl_updaterate" ) );
would
Code:
engine->IndexOfEdict(pEntity)
be the same as i always?
3jorn is offline
API
Veteran Member
Join Date: May 2006
Old 08-06-2007 , 15:06   Re: Index of entity
Reply With Quote #2

While they are in-game, yes, btw, it should be
Code:
for(int x=1;x<=maxplayers;x++)
__________________
API is offline
Send a message via AIM to API
3jorn
Junior Member
Join Date: May 2007
Old 08-07-2007 , 05:06   Re: Index of entity
Reply With Quote #3

Of course, <=maxplayers , cheers.

Been spinning around too long with the code, was going "blind".
I can safely change engine->IndexOfEdict to i instead then as I actually use i to get the edict in the first place whoops
3jorn 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 19:05.


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