Dom_152 Posted November 4, 2006 Share Posted November 4, 2006 I have a boolean in the server side client->pers structure and now I want to use that boolean to determine if the client should draw something extra on the scoreboard. My question is how can I access the state of that boolean from cg_scorboard.c or in any cg_xxx.x file? Link to comment Share on other sites More sharing options...
Tinny Posted November 5, 2006 Share Posted November 5, 2006 Ooh, I don't know much about client->pers but I know the client->ps (playerState) can be edited from q_shared.h. This is the tricky thing though, editing q_shared.h can really mess everything else up so I would stick with using userints. Even if you do edit userint though, you have to make sure enough bits are being sent across the network to represent it properly, so you'll need to edit the external netf_overrides and psf_overrides too (I can tell you where those are if you don't know). Link to comment Share on other sites More sharing options...
ensiform Posted November 5, 2006 Share Posted November 5, 2006 An easier way would be to send it in ClientUserinfoChanged. pers.myqboolean and x being the key being stored to be recognized in client. Note: Don't just copy and paste this as it appears to have extra spaces in the s = va() area but it really doesn't. // send over a subset of the userinfo keys so other clients can // print scoreboards, display models, and play custom sounds if ( ent->r.svFlags & SVF_BOT ) { s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\skill\\%s\\tt\\%d\\tl\\%d\\siegeclass\\%s\\st\\%s\\st2\\%s\\dt\\%i\\sdt\\%i\\x\\%d", client->pers.netname, team, model, c1, c2, client->pers.maxHealth, client->sess.wins, client->sess.losses, Info_ValueForKey( userinfo, "skill" ), teamTask, teamLeader, className, saberName, saber2Name, client->sess.duelTeam, client->sess.siegeDesiredTeam, client->pers.myqboolean); } else { if (g_gametype.integer == GT_SIEGE) { //more crap to send s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d\\siegeclass\\%s\\st\\%s\\st2\\%s\\dt\\%i\\sdt\\%i\\x\\%d", client->pers.netname, client->sess.sessionTeam, model, c1, c2, client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader, className, saberName, saber2Name, client->sess.duelTeam, client->sess.siegeDesiredTeam, client->pers.myqboolean); } else { s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d\\st\\%s\\st2\\%s\\dt\\%i\\x\\%d", client->pers.netname, client->sess.sessionTeam, model, c1, c2, client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader, saberName, saber2Name, client->sess.duelTeam, client->pers.myqboolean); } } Add it to the end of the s char, then you can get it in the clientinfo in cg_players.c: CG_NewClientInfo // myqboolean x v = Info_ValueForKey( configstring, "x" ); newInfo.myqboolean = atoi( v ); Link to comment Share on other sites More sharing options...
Dom_152 Posted November 5, 2006 Author Share Posted November 5, 2006 Thank you. And for the record I barely ever Copy-Paste example code as I like to write it out step by step so I know what I'm doing. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.