[CS:GO] player.friction

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
velocity
Senior Member
Posts: 163
Joined: Sat May 10, 2014 6:17 pm

[CS:GO] player.friction

Postby velocity » Thu Nov 08, 2018 7:31 pm

Looks like setting the player.friction doesn't work, friction remains the same. I tried with others like player.gravity which worked fine.

On Spawn
-> player.friction =8
User avatar
Ayuto
Project Leader
Posts: 1918
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [CS:GO] player.friction

Postby Ayuto » Sun Nov 11, 2018 3:53 pm

Could you please try this?:

Syntax: Select all

player.set_network_property_float('m_flFriction', 8)
User avatar
velocity
Senior Member
Posts: 163
Joined: Sat May 10, 2014 6:17 pm

Re: [CS:GO] player.friction

Postby velocity » Tue Nov 13, 2018 2:06 pm

I certainly will! How do I know if it is a network_property or just set_property?
User avatar
Ayuto
Project Leader
Posts: 1918
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [CS:GO] player.friction

Postby Ayuto » Tue Nov 13, 2018 4:28 pm

set_property_X is just a wrapper for set_network_property_X and set_datamap_property_X. If it's a network property it will use the first method, else the latter.
User avatar
velocity
Senior Member
Posts: 163
Joined: Sat May 10, 2014 6:17 pm

Re: [CS:GO] player.friction

Postby velocity » Fri Nov 16, 2018 2:20 pm

It doesn't work

Syntax: Select all

player.set_network_property_float('m_flFriction', 8)
not even with set_property
User avatar
Ayuto
Project Leader
Posts: 1918
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: [CS:GO] player.friction

Postby Ayuto » Fri Nov 16, 2018 3:19 pm

Then it's probably a read-only property.
User avatar
Kami
Global Moderator
Posts: 143
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

Re: [CS:GO] player.friction

Postby Kami » Fri Nov 16, 2018 6:13 pm

Hey, I'm not sure if this works the same way it does in Sourcemod but it seems they can send different values of the same convar to different players.

I found Player.send_convar_value(cvar_name, value) in the documentation, so you could propably try and do:

Syntax: Select all

player.send_convar_value("sv_friction", 0.1)


I'm not sure what values go for friction but you get the idea.

You may need to remove the NOTIFY flag from sv_friction or it will tell the player that you changed it.

Edit:

I did a test with this method and I couldn't get it to work this way either :(
User avatar
velocity
Senior Member
Posts: 163
Joined: Sat May 10, 2014 6:17 pm

Re: [CS:GO] player.friction

Postby velocity » Sat Nov 17, 2018 7:46 pm

yeah, it doesn't work either :(

A sourcemod plugin does it tho: https://forums.alliedmods.net/showthread.php?p=2537196

Return to “Plugin Development Support”

Who is online

Users browsing this forum: Doldol and 3 guests