Raised This Month: $ Target: $400
 0% 

AWP & SCOUT auto fast switch


Post New Thread Reply   
 
Thread Tools Display Modes
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-24-2009 , 14:02   Re: AWP & SCOUT auto fast switch
Reply With Quote #11

Quote:
Originally Posted by arkshine View Post
Just by looking and playing with the HLSDK and you will see it's not that hard.
Yes. I'm just saying that Connor knows it all
joaquimandrade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-24-2009 , 14:14   Re: AWP & SCOUT auto fast switch
Reply With Quote #12

Quote:
Originally Posted by joaquimandrade View Post
Yes. I'm just saying that Connor knows it all
Just worked on a zoom stats plugin yesterday, that's why i had this avaible code
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-24-2009 , 14:22   Re: AWP & SCOUT auto fast switch
Reply With Quote #13

Quote:
Originally Posted by ConnorMcLeod View Post
Just worked on a zoom stats plugin yesterday, that's why i had this avaible code
joaquimandrade is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 02-25-2009 , 03:16   Re: AWP & SCOUT auto fast switch
Reply With Quote #14

HELP !?!

Code:
 
#define PLUGIN_NAME "Fast Zoom"
#define PLUGIN_VERSION "0.3"
#define PLUGIN_AUTHOR "80T"
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define FOV_DEFAULT 90
new g_toggle;
public plugin_init()
{
 register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
 RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_awp", "fast_unscope")
 RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_scout", "fast_unscope")
 g_toggle = register_cvar("fast_zoom", "1");
}
public fast_unscope(id)
{
 if(get_pcvar_num(!g_toggle) == 1)
  return PLUGIN_CONTINUE;
  
 new fov;
 if((fov = pev(id, pev_fov)) >= FOV_DEFAULT || !fov)
  return PLUGIN_CONTINUE;
 
 set_task(0.1, "unscope", id);
 
 return PLUGIN_CONTINUE;
}
public unscope(id)
{
 client_cmd(id, "lastinv;wait;+attack;wait;-attack");
 set_task(0.1, "switch_back", id);
}
public switch_back(id)
{
 client_cmd(id, "slot1;wait;+attack;wait;-attack");
}
 
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
I don't understand what's wrong with this code....
And let me remind you that I'm a total noob and this is probably one thing that I shouldn't be doing (scripting)
Costin83 is offline
Send a message via Yahoo to Costin83
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-25-2009 , 10:59   Re: AWP & SCOUT auto fast switch
Reply With Quote #15

If you don't apply the filters i've written in previous code, you can't know if a shot is being performed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 02-26-2009 , 01:10   Re: AWP & SCOUT auto fast switch
Reply With Quote #16

Quote:
Originally Posted by ConnorMcLeod View Post
If you don't apply the filters i've written in previous code, you can't know if a shot is being performed.
Sorry, I thought that Ham_Weapon_PrimaryAttack does this things alltogether, I just wanted to keep it as simple as possible

So here is your code:

Code:
 
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN_NAME "Fast Zoom"
#define PLUGIN_VERSION "0.3"
#define PLUGIN_AUTHOR "80T"
const m_pPlayer   = 41
const m_flNextPrimaryAttack = 46
const m_flNextSecondaryAttack = 47
const m_iClip   = 51
const m_iFOV   = 363
new g_toggle;
public plugin_init()
{
 register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
 RegisterHam(Ham_Item_PostFrame, "weapon_awp", "Sniper_PostFrame")
 RegisterHam(Ham_Item_PostFrame, "weapon_scout", "Sniper_PostFrame")
 g_toggle = register_cvar("fast_zoom", "1");
}
public Sniper_PostFrame(iEnt)
{
 if(get_pcvar_num(!g_toggle) == 1)
  return PLUGIN_CONTINUE;
 
 static id; id = get_pdata_cbase(iEnt, m_pPlayer, 4)
 static iButton; iButton = pev(id, pev_button)
 
 if((!(iButton & IN_ATTACK2) || get_pdata_float(iEnt, m_flNextSecondaryAttack, 4) > 0.0)
 && (iButton & IN_ATTACK)
 && get_pdata_int(iEnt, m_iClip, 4)
 && get_pdata_float(iEnt, m_flNextPrimaryAttack, 4) <= 0.0)
 {
  if( get_pdata_int(id, m_iFOV, 5) < 90)
  {
   client_cmd(id, "wait;lastinv;wait;+attack;wait;-attack");
   set_task(0.1, "switch_back", id);
  }
 }
 return PLUGIN_CONTINUE;
}
public switch_back(id)
{
 client_cmd(id, "slot1;wait;+attack;wait;-attack");
}
 
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
And still not working. It acts exactly the same I don't understand....
Costin83 is offline
Send a message via Yahoo to Costin83
Reply


Thread Tools
Display Modes

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 20:22.


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