Raised This Month: $ Target: $400
 0% 

[CSGO] How to set different friction for each player?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lolz123
Member
Join Date: Aug 2010
Old 06-12-2015 , 08:18   [CSGO] How to set different friction for each player?
Reply With Quote #1

How do i set different friction for each player?

already tried
SetEntPropFloat(client, Prop_Send, "m_flFriction", 0.15);
SetEntPropFloat(client, Prop_Data, "m_flFriction", 0.15);

but it's not working.
i've searched a lot but couldn't find a solution, help me please
Lolz123 is offline
Mehis
Senior Member
Join Date: Mar 2013
Location: basement
Old 06-12-2015 , 10:12   Re: [CSGO] How to set different friction for each player?
Reply With Quote #2

This is how I did player specific air acceleration.
I haven't tested this, though.

PHP Code:
ConVar g_ConVar_Friction;

float g_flClientFriction[MAXPLAYERS] = { 6.0, ... }; // CHANGE ME!

public void OnPluginStart()
{
    
g_ConVar_Friction FindConVar"sv_friction" );
    
    if ( 
g_ConVar_Friction == null )
        
SetFailState"Unable to find cvar handle for sv_friction!" );
    
    
int flags GetConVarFlagsg_ConVar_Friction );
    
    
flags &= ~FCVAR_NOTIFY;
    
flags &= ~FCVAR_REPLICATED;
    
    
SetConVarFlagsg_ConVar_Frictionflags );
}

public 
void OnClientPutInServerint client )
{
    
g_flClientFriction[client] = 6.0;
    
SendNewFrictionclient6.0 );
    
    
SDKHookclientSDKHook_PreThinkPostEvent_PreThinkPost_Client );
}

public 
void Event_PreThinkPost_Clientint client )
{
    
SetConVarFloatg_ConVar_Frictiong_flClientFriction[client] );
}

stock void SendNewFrictionint clientfloat friction )
{
    
char szValue[6];
    
FormatExszValuesizeofszValue ), "%0.f"friction );
    
    
SendConVarValueclientg_ConVar_FrictionszValue );


Last edited by Mehis; 06-12-2015 at 10:16.
Mehis is offline
Lolz123
Member
Join Date: Aug 2010
Old 06-13-2015 , 10:54   Re: [CSGO] How to set different friction for each player?
Reply With Quote #3

Thanks
Lolz123 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 05:55.


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