i can set the keyvalue 'gravity' with out any problem and it works perfectly but when i want to get the value but i get 0.0 when infacts it's no where near that value..
Engine bug or source python problem ?
edict_t.GetKeyValue() problem
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Hey Tuck,
Just tested, works fine for me.
L'In20Cible
Just tested, works fine for me.
Syntax: Select all
from events import Event
from players.entity import PlayerEntity
from players.helpers import index_from_userid
@Event
def player_jump(GameEvent):
player = PlayerEntity(index_from_userid(GameEvent.GetInt('userid')))
print(player.edict.GetKeyValue('gravity'))
player.edict.SetKeyValueFloat('gravity', 0.5)
print(player.edict.GetKeyValue('gravity'))
Code: Select all
0.000000
0.500000
L'In20Cible
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
You would think that the value "should" be 1.0, but it isn't. That is not the fault of the plugin, however, as that will be the same value no matter what plugin you are using. It is simply the value Valve sets it to. On another note, if you set a player's gravity to 0.0 after having changed it to another value, it has the same effect of setting it to 1.0. I'm not sure why this is, but it is.
Satoon
Satoon
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 75 guests