int iBulletsToFire = 0; float demifireRate = 0.1f; while ( m_flNextPrimaryAttack <= g_pGlobals->curtime + 0.1f ) { m_flNextPrimaryAttack = m_flNextPrimaryAttack + demifireRate; iBulletsToFire++; } if ( iBulletsToFire > m_iClip1 ) iBulletsToFire = m_iClip1; m_iClip1 -= iBulletsToFire; if(iBulletsToFire)//whops forget something here :D. { //put your blahblah here. }
Announcement
Collapse
No announcement yet.
Fast AutoPistol
Collapse
This topic is closed.
X
X
-
Fast AutoPistol
Hello ,I share my solution here.
Code:
Tags: None
-
Re: Fast AutoPistol
Originally posted by [CE]_.Kamay View Postwrong k maybe, but i miss some credits no.
If you have a better solution share it.
edit :
maybe some credits for the idea with m_flNextPrimaryAttack
anyway if you feel no credits are needed, just tell me who gaved you the initial code with m_flNextPrimaryAttack which you completely started off.
Comment
-
Re: Fast AutoPistol
Originally posted by sshare View Postid like to care to spoon feed codes directly in your throat.
anyway if you feel no credits are needed, just tell me who gaved you the initial code with m_flNextPrimaryAttack which you completely started off.
// To make the firing framerate independent, we may have to fire more than one bullet here on low-framerate systems,
// especially if the weapon we're firing has a really fast rate of fire.
int iBulletsToFire = 0;
float fireRate = GetFireRate();
// MUST call sound before removing a round from the clip of a CHLMachineGun
while ( m_flNextPrimaryAttack <= gpGlobals->curtime )
{
WeaponSound(SINGLE, m_flNextPrimaryAttack);
m_flNextPrimaryAttack = m_flNextPrimaryAttack + fireRate;
iBulletsToFire++;
}
// Make sure we don't fire more than the amount in the clip, if this weapon uses clips
if ( UsesClipsForAmmo1() )
{
if ( iBulletsToFire > m_iClip1 )
iBulletsToFire = m_iClip1;
m_iClip1 -= iBulletsToFire;
}
look in basehlcombatweapon.cpp if you dont believe me. Next shitty arguents of you i close the thread sadly.
peaceLast edited by [CE]_.Kamay; 09-09-2012, 08:43 AM.
Comment
-
Re: Fast AutoPistol
Originally posted by sshare View Postyou probably didnt read my previous postLast edited by [CE]_.Kamay; 09-09-2012, 09:17 AM.
Comment
Comment