Raised This Month: $32 Target: $400
 8% 

[TF2] Short circuit secondary fire feature to primary fire


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 08-13-2016 , 15:11   [TF2] Short circuit secondary fire feature to primary fire
Reply With Quote #1

So to make it i think i'll need OnPlayerRunCmd and particle (or is it a projectile also?) touching the projectile to remove it, but how do i detect particle touching the projectile?
Nursik is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 08-23-2016 , 04:17   Re: [TF2] Short circuit secondary fire feature to primary fire
Reply With Quote #2

Can someone help me detect when the projectile is close to an engie at least?

Last edited by Nursik; 08-23-2016 at 04:18.
Nursik is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 08-25-2016 , 05:51   Re: [TF2] Short circuit secondary fire feature to primary fire
Reply With Quote #3

Actually you want to block the secondary attack of the short circuit, and force the primary attack instead?

Edit:
If you want to do that I made the code for you:
Code:
#define SHORT_CIRCUIT 528 public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]) {     if(client >= 1 && client <= MaxClients && IsClientInGame(client))     {         int iActiveWep = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");//Get the active weapon of the player.         if (iActiveWep > MaxClients && GetEntProp(iActiveWep, Prop_Send, "m_iItemDefinitionIndex") == SHORT_CIRCUIT)//Detecting the classname tf_weapon_mechanical_arm would also work.         {             if (buttons & IN_ATTACK2)//If the player is pressing the secondary attack button             {                 buttons &= ~IN_ATTACK2; //Trick the server into thinking the player didn't press the secondary attack button.                 buttons |= IN_ATTACK; //Trick the server into thinking the player pressed the primary attack button.                 //Note: If the secondary attack button is linked to some animations, they will still be played on the client-side, because of client's prediction (It can't be avoided).             }         }     } }
__________________

Last edited by Benoist3012; 08-25-2016 at 06:01.
Benoist3012 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:48.


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