Hi,
I am trying to get my plugin to remember players money, frags and deaths over a retry. I can set the money and frags without any issue, but even though I store the deaths and update the deaths at the same time as the frags, the deaths always remain at 0.
Here is my snippet of code for setting the clients score when the server calls gmsgInitHUD.
Any help or insight would be appreciated,
Thanks,
Matt.
(wonid is left over from 1.5 :)
sprintf(mysqlbuf, "SELECT money,frags,deaths FROM retry WHERE wonid=\"%s\" AND server=\"%s\"", GETPLAYERAUTHID(pEntity),CVAR_GET_STRING("ip")); _mysql_query(mysqlbuf);
if(mysql_num_rows(mysql_res) > 0) { mysql_row = mysql_fetch_row(mysql_res);
*((int *)pEntity->pvPrivateData + OFFSET_CSMONEY) = atoi(mysql_row[0]);
pPlayer->frags = atoi(mysql_row[1]); pPlayer->deaths = atoi(mysql_row[2]);
pEntity->v.frags = pPlayer->frags; *((int *)pEntity->pvPrivateData + OFFSET_CSDEATHS) = pPlayer->deaths;
MESSAGE_BEGIN( MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreInfo", NULL) ); WRITE_BYTE( ENTINDEX(pEntity) ); WRITE_SHORT( pPlayer->frags ); WRITE_SHORT( pPlayer->deaths ); WRITE_SHORT( 0 ); WRITE_SHORT( pEntity->v.team + 1 ); MESSAGE_END(); }
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders