Talk:Ammunition

From Valve Developer Community
Jump to: navigation, search

I think we should consider adding other ammunition from games like Left 4 Dead in here, perhaps even Alien Swarm?--MrFourVideoCards 11:30, 1 March 2011 (UTC)

Sounds good to me. I looked at the CS:S ammo entities but since they are invisible they didn't seem worth listing. Thelonesoldier 20:51, 1 March 2011 (UTC)

How can I get ammo entities from server plugin?

Posting answer I just figured out:

for (int i = 0; i < pEngineServer->GetEntityCount(); ++i)
{
	edict_t* pEdict = pEngineServer->PEntityOfEntIndex(i);
	if (pEdict && StartsWith(pEdict->GetClassName(), "item_ammo_"))
	{
		// Do your stuff
	}
}

User:Borzh62 5 July 2012

Also how can I get ammo left in current bot's weapon? User:Borzh62 17 June 2012