I'm kinda lost why this won't work.
Code:
for ( int i = 0; i < gpGlobals->maxClients; i++ )
{
pPlayer = INDEXENT(i + 1);
if (!FNullEnt (pPlayer) && (pPlayer->v.flags & FL_CLIENT))
{
pPlayer->v.frags += m_Score;
MESSAGE_BEGIN(MSG_ONE, GET_USER_MSG_ID(PLID, "ScoreInfo", NULL), NULL, pPlayer); // neither MSG_ONE_UNRELIABLE
WRITE_BYTE(ENTINDEX(pPlayer)); // user index
WRITE_SHORT((int)pPlayer->v.frags); // frags
WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS)); // deaths
WRITE_SHORT(0); // ?
WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSETS_TEAM)); // team
MESSAGE_END();
}
}
Which throws this error message:
Code:
FATAL ERROR (shutting down): MSG_ONE or MSG_ONE_UNRELIABLE with no target entity
I know I can use this method which works just fine.
Code:
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreInfo", NULL));
WRITE_BYTE(ENTINDEX(pevAttacker)); // user index
WRITE_SHORT((int)pevAttacker->v.frags); // frags
WRITE_SHORT(*((int *)pevAttacker->pvPrivateData + OFFSET_CSDEATHS)); // deaths
WRITE_SHORT(0); // ?
WRITE_SHORT(*((int *)pevAttacker->pvPrivateData + OFFSETS_TEAM)); // team
MESSAGE_END();
But I have to use the 1st one which aren't working.