AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detecting attack2 with c4 (https://forums.alliedmods.net/showthread.php?t=99434)

SnoW 08-05-2009 09:36

Detecting attack2 with c4
 
Is there some reason why Ham_Weapon_SecondaryAttack isn't called with weapon_c4? Since I think it isn't possible to do with that, I were hoping there would be a better way than checking players current weapon and buttons in cmdstart.

Arkshine 08-05-2009 09:46

Re: Detecting attack2 with c4
 
Because there is not a secondary attack for this weapon.

SnoW 08-05-2009 09:52

Re: Detecting attack2 with c4
 
Quote:

Originally Posted by Arkshine (Post 890779)
Because there is not a secondary attack for this weapon.

That shouldn't matter. It's called for example for hegrenade even it doesn't have secondary attack action either.

Arkshine 08-05-2009 12:12

Re: Detecting attack2 with c4
 
It does matter, it means that in the code for the C4 weapon, there is not secondary attack. Edit :

Code:

CC4::Deploy(void)                                                             
CC4::GetItemInfo(ItemInfo *)                                               
CC4::GetMaxSpeed(void)                                                       
CC4::Holster(int)                                                           
CC4::KeyValue(KeyValueData_s *)                                             
CC4::Precache(void)                                                           
CC4::PrimaryAttack(void)                                                     
CC4::Spawn(void)
CC4::Use(CBaseEntity *,CBaseEntity *,USE_TYPE,float)                     
CC4::UseDecrement(void)                                                     
CC4::WeaponIdle(void)                                                         
CC4::iItemSlot(void)

The HE grenade has a secondary attack function, but it's empty, you can see:

Code:

CHEGrenade::.ShieldSecondaryFire(int,int)                                   
CHEGrenade::CanDeploy(void)                                             
CHEGrenade::CanDrop(void)                                                   
CHEGrenade::Deploy(void)                                         
CHEGrenade::GetItemInfo(ItemInfo *)                                           
CHEGrenade::GetMaxSpeed(void)                                         
CHEGrenade::Holster(int)                                                     
CHEGrenade::Precache(void)                                             
CHEGrenade::PrimaryAttack(void)                                             
CHEGrenade::ResetPlayerShieldAnim(void)                                   
CHEGrenade::SecondaryAttack(void)                                           
CHEGrenade::SetPlayerShieldAnim(void)                                 
CHEGrenade::ShieldSecondaryFire(int,int)                                 
CHEGrenade::Spawn(void)                                               
CHEGrenade::UseDecrement(void)                                             
CHEGrenade::WeaponIdle(void)                                           
CHEGrenade::iItemSlot(void)


ConnorMcLeod 08-05-2009 12:30

Re: Detecting attack2 with c4
 
Maybe this function exists for nade so ShieldSecondaryFire can be called then.

Arkshine 08-05-2009 12:41

Re: Detecting attack2 with c4
 
Just to complete the 2 others nades for information.

Code:

CFlashbang::.ShieldSecondaryFire(int,int)                                     
CFlashbang::CanDeploy(void)         
CFlashbang::CanDrop(void)                                                     
CFlashbang::Deploy(void)                                                 
CFlashbang::GetItemInfo(ItemInfo *)                       
CFlashbang::GetMaxSpeed(void)                                             
CFlashbang::Holster(int)                                       
CFlashbang::IsPistol(void)                                             
CFlashbang::Precache(void)                                           
CFlashbang::PrimaryAttack(void)                                           
CFlashbang::ResetPlayerShieldAnim(void)                           
CFlashbang::SecondaryAttack(void)                         
CFlashbang::SetPlayerShieldAnim(void)                             
CFlashbang::ShieldSecondaryFire(int,int)                         
CFlashbang::Spawn(void)                                         
CFlashbang::UseDecrement(void)                                   
CFlashbang::WeaponIdle(void)                                   
CFlashbang::iItemSlot(void)

Code:

CSmokeGrenade::.ShieldSecondaryFire(int,int)                                 
CSmokeGrenade::CanDeploy(void)                                           
CSmokeGrenade::CanDrop(void)                                               
CSmokeGrenade::Deploy(void)                                                 
CSmokeGrenade::GetItemInfo(ItemInfo *)                                 
CSmokeGrenade::GetMaxSpeed(void)                                         
CSmokeGrenade::Holster(int)                                         
CSmokeGrenade::Precache(void)                                             
CSmokeGrenade::PrimaryAttack(void)                                         
CSmokeGrenade::ResetPlayerShieldAnim(void)                               
CSmokeGrenade::SecondaryAttack(void)                                     
CSmokeGrenade::SetPlayerShieldAnim(void)                                     
CSmokeGrenade::ShieldSecondaryFire(int,int)                             
CSmokeGrenade::Spawn(void)                                                   
CSmokeGrenade::UseDecrement(void)                                           
CSmokeGrenade::WeaponIdle(void)                                           
CSmokeGrenade::iItemSlot(void)

So SnoW you have probably to use FM_CmdStart.

SnoW 08-05-2009 14:06

Re: Detecting attack2 with c4
 
Ye, thanks ark.


All times are GMT -4. The time now is 18:31.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.