Using PlayerEntity.speed didn't give me any change of player speed, so I decided to use set_property_float('m_flLaggedMovementValue'). Whenever I modify this value and I jump, I seem to freeze and the server console spits out this:
DataTable warning: player: Out-of-range value (929.852112) in SendPropFloat 'm_flStamina', clamping.
DataTable warning: player: Out-of-range value (931.689636) in SendPropFloat 'm_flStamina', clamping.
DataTable warning: player: Out-of-range value (932.608398) in SendPropFloat 'm_flStamina', clamping.
DataTable warning: player: Out-of-range value (933.527161) in SendPropFloat 'm_flStamina', clamping.
DataTable warning: player: Out-of-range value (934.445923) in SendPropFloat 'm_flStamina', clamping.
DataTable warning: player: Out-of-range value (935.364685) in SendPropFloat 'm_flStamina', clamping.
DataTable warning: player: Out-of-range value (937.202209) in SendPropFloat 'm_flStamina', clamping.
Any work around or optimal solution?
Changing player speed
Entity.speed for players (also PlayerEntity) should be getting/setting CBasePlayer.localdata.m_flLaggedMovementValue. Make sure you are passing it a float when setting the value. For other entities, the speed entity KeyValue is retrieved/set with Entity.speed.
Also, PlayerEntity.speed has worked fine for me, but I will have to verify that when I get home tonight.
What game is this for, btw?
Also, PlayerEntity.speed has worked fine for me, but I will have to verify that when I get home tonight.
What game is this for, btw?
Actually it's working fine for me. On which game did you test that and did you update your SP files?
Syntax: Select all
from players.entity import PlayerEntity
from players.helpers import index_from_userid
from events import Event
@Event
def player_jump(event):
userid = event.get_int('userid')
index = index_from_userid(userid)
player = PlayerEntity(index)
# Double the speed
player.speed = 2
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 120 guests