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

[CS:GO] How to stop reload animation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 08-27-2017 , 13:45   [CS:GO] How to stop reload animation
Reply With Quote #1

Code:
public OnPluginStart()
{
	HookEvent("weapon_reload", weapon_reload);
}

public weapon_reload(Handle:event, const String:name[], bool:silent)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	new weapon = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon");
	new Float:curtime = GetGameTime();
	new Float:nexttime = GetEntPropFloat(weapon, Prop_Send, "m_flNextPrimaryAttack");
	nexttime -= curtime;
	nexttime *= 1.0/4.0;
	nexttime += curtime;

	SetEntPropFloat(weapon, Prop_Send, "m_flNextPrimaryAttack", nexttime);
	SetEntPropFloat(client, Prop_Send, "m_flNextAttack", nexttime);
}
this code make reload speed x4 faster, but how make reload animation x4 faster or stop when reload ends
Indarello is offline
fiction
Member
Join Date: May 2017
Old 08-27-2017 , 16:22   Re: [CS:GO] How to stop reload animation
Reply With Quote #2

You can do this by modifying the m_flPlaybackRate of the player's view-model and the weapon itself, take a look at how it's handled in SM:RPG.
fiction is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 08-28-2017 , 01:44   Re: [CS:GO] How to stop reload animation
Reply With Quote #3

Code:
		SetEntPropFloat(weapon, Prop_Send, "m_flPlaybackRate", reloadmodify[client]);
		new iViewModel = GetEntPropEnt(client, Prop_Send, "m_hViewModel");
		if(iViewModel != INVALID_ENT_REFERENCE) SetEntPropFloat(iViewModel, Prop_Send, "m_flPlaybackRate", reloadmodify[client]);
		SetEntPropFloat(weapon, Prop_Send, "m_flTimeWeaponIdle", nexttime);
what about world animation?
Indarello 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 19:27.


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