Originally Posted by __37__
hey Beetle, just want to say that your mod is awesome and we run it on both of our servers. thanks for the quick reply here also.
i guess what i am wondering is, what is playerinfomanager->GetPlayerInfo(pEntity) setting playerinfo to and what is the value that pEntity holds? is it like their steam id or slot number within the server? where does pEntity obtain the value used that is sent to GetPlayerInfo?
i see that when a client connects, the CEmptyServerPlugin::ClientActive function is called, and it is passed an (edict_t *pEntity). I have also noticed that edict_t is used everytime referencing a player. What is endict_t ?
Sorry for all the low level questions here, and i know that there are several resources out there that probably explain this, i just don't know where to start or what keywords to search for.
and edict_t * pEntity is the internal structure valve uses to represent all entities..
its not really usuable by u or me in it self (there are class pointers you can use but thats for more advanced programmers)
IPlayerInfo * is a pointer that valve provides to allow programmers to access more information about the pEntity..
IPlayerInfo * playerinfo has many class members that allow you to find out more info about the entity..
playerinfo->GetUserId(); returns the UserId ...the unique interger value for each player that increments for every new player...
theres playerinfo->GetNetworkIDString(); which returns a const char * to there steamid
(u can also use engine->GetPlayerNetworkIDString(pEntity); to get steamid as well bypassing the use of playerinfo)
theres int index=engine->IndexOfEdict(pEntity);
which gives the slot number (integer value from 1 to PlayersMax).