You need to do
if ( playerinfo ){
Msg("SteamId: %s\n", playerInfo->GetNetworkIDString());
}
Not if !playerinfo
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ronny Schedel
Sent: Sunday, December 05, 2004 7:34 AM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] IVEngineServer::PEntityOfEntIndex(int iEntIndex)
issue in Plugin
I cant see any errors, maybe a wrong playerIndex?
Must be greater than 0.
Greets
Ronny
> Is anyone able to help with this?
>
>
> On Sun, 5 Dec 2004 00:47:59 +0000, Tristan Fairbairn
> <[EMAIL PROTECTED]> wrote:
>> Hi list,
>>
>> I'm messing about with a plugin and i'm getting a crash when trying to
>> access an edict_t* returned by PEntityOfEntIndex(int iEntIndex)
>>
>> I'm basically trying to find out info about entities based on the
>> client index (eventually i'd like to do it based on name and/or steam
>> id).
>>
>> Code goes a little like this:
>>
>> edict_t *entity = engine->PEntityOfEntIndex(playerIndex);
>> if (!entity) ...
>>
>> IPlayerInfo *playerInfo = playerinfomanager->GetPlayerInfo(entity);
>> if (!playerInfo) ...
>>
>> // This line causes a crash
>> Msg("SteamId: %s\n", playerInfo->GetNetworkIDString());
>>
>> I'm almost certainly doing something wrong, or perhaps my approach is
>> totally wrong for what i'm trying to achive. So any thoughts?
>>
>> ta,
>>
>> Trimbo
>>
>
> _______________________________________________
> 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
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders