Raised This Month: $51 Target: $400
 12% 

[Help] awp and scout re-zoom speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
explas93
New Member
Join Date: Dec 2019
Old 12-15-2019 , 04:04   [Help] awp and scout re-zoom speed
Reply With Quote #1

Weapons fire speed can be changed as i use below, but the re-scope time of awp and scout is something i cant manipulate, how should i change these data?
Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "Scout ROF"
#define VERSION "1.0"
#define AUTHOR "Explas"

#define    m_flNextPrimaryAttack    46
#define    m_flNextSecondaryAttack    47
#define    m_flTimeWeaponIdle        48

new g_NormSpeed
const OFFSET_LINUX_WEAPONS 			= 4;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)

	g_NormSpeed = register_cvar("hms_scout_normspeed","0.9")

	RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_scout", "fw_primary_attack_post",1)

}

public fw_primary_attack_post(ent) {
	if(!pev_valid(ent))
		return HAM_IGNORED;
	// Speed
	static Float:def_speed[3];
	def_speed[0] = get_pdata_float(ent, 46, OFFSET_LINUX_WEAPONS);
	def_speed[1] = get_pdata_float(ent, 47, OFFSET_LINUX_WEAPONS);
	def_speed[2] = get_pdata_float(ent, 48, OFFSET_LINUX_WEAPONS);
		set_pdata_float(ent, 46, def_speed[0] * get_pcvar_float(g_NormSpeed), OFFSET_LINUX_WEAPONS)
		set_pdata_float(ent, 47, def_speed[1] * get_pcvar_float(g_NormSpeed), OFFSET_LINUX_WEAPONS)
		set_pdata_float(ent, 48, def_speed[2] * get_pcvar_float(g_NormSpeed), OFFSET_LINUX_WEAPONS)		

	return HAM_IGNORED;	
}
explas93 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-16-2019 , 03:10   Re: [Help] awp and scout re-zoom speed
Reply With Quote #2

you can manually set the zoom level in client_prethink(). get the use get_systime() to get the time at which the scope was used and then store it in a variable. then check the keys pressed and etc.

May not be the most efficient way, but it works
__________________
retired chump
DjSoftero 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 18:39.


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