Coasterdude Posted March 17, 2007 Share Posted March 17, 2007 How do I access ammo? ent->client->ps.ammo[weapon] Is it like that? Or is that wrong? and how do I access weapons? ent->client->ps.weapon Like that? lol I'm not sure. Link to comment Share on other sites More sharing options...
ensiform Posted March 17, 2007 Share Posted March 17, 2007 the ammo is an array and its the ammo defines in bg_weapons files. so... ent->client->ps.ammo[AMMO_BLASTER] is ammo you have for blaster-type weapons. the weapon int is players current weapon. Weapons are stored in stats[sTAT_WEAPONS] and you cannot have more than 19 bits. all other STAT_ items cannot have more than 16 bits. theres no easy way to describe how to check weapons especially if you have no knowledge of how bits work... but: if (ent->client->ps.stats[sTAT_WEAPONS] & (1 << WP_SABER)) // has saber ent->client->ps.stats[sTAT_WEAPONS] |= (1 << WP_MELEE); // append melee ent->client->ps.weapon = WP_SABER; // set current weapon ent->client->ps.stats[sTAT_WEAPONS] &= ~(1 << WP_ROCKET_LAUNCHER); // removes rocket launcher Link to comment Share on other sites More sharing options...
Coasterdude Posted March 17, 2007 Author Share Posted March 17, 2007 K, thanks, and what controls walking and crouching and being still? Link to comment Share on other sites More sharing options...
ensiform Posted March 17, 2007 Share Posted March 17, 2007 positive forwardmove in ucmd means going forwards negative forwardmove in ucmd means going backwards positive rightmove in ucmd means going right negative rightmove in ucmd means going left positive upmove in ucmd means jumping negative upmove in ucmd means crouching (also pm_flag PMF_DUCKED) represents actually crouching) what exactly are you looking to do here? Link to comment Share on other sites More sharing options...
Coasterdude Posted March 17, 2007 Author Share Posted March 17, 2007 awesome thanks man, im doing weapon accuracy based on condition of player. and also trying to do reload lol. Link to comment Share on other sites More sharing options...
Coasterdude Posted March 18, 2007 Author Share Posted March 18, 2007 omg. My compiler is just making random errors now..lol. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.