Jump to content

Home

couple questions


Coasterdude

Recommended Posts

Posted

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.

Posted

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

Posted

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...