Author Topic: Help with spawning AK-47  (Read 693 times)

techwarfare

  • Newbie
  • *
  • Posts: 18
    • View Profile
Help with spawning AK-47
« on: February 14, 2015, 08:31:15 AM »
Hello War3source its been awhile since my last post, I'm here to ask if any of you guys could help me.See I'm making a race that has a chance of spawning with a ak with 200 bullets in it, the problem is I'm not sure where I should start in getting the ak to spawn? So if any of you could nudge me in the right direction that would be appreciated.

Thanks,
Techy.

Revan

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Help with spawning AK-47
« Reply #1 on: February 14, 2015, 11:49:11 AM »
Spawn it via GivePlayerItem.

Set primary ammo(just pass the AK47 entity index to SetEntData if you just want to modify AK ammo):
Code: [Select]
stock SetPrimaryAmmo(client,ammo)
{
    new iWeapon = GetEntDataEnt2(client, FindSendPropInfo("CCSPlayer", "m_hActiveWeapon"));
   
    return SetEntData(iWeapon, FindSendPropInfo("CBaseCombatWeapon", "m_iClip1"), ammo);
}
#war3source on gamesurge

techwarfare

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Help with spawning AK-47
« Reply #2 on: February 14, 2015, 04:14:40 PM »
So I've got the AK spawning, there is two other things i need help with now. I need help with making the chance to spawn the AK and that the AK spawns on every round start, with the 200 bullets.