Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.
New to the forum? Say hello in this topic! Also make sure to read the rules.
New to the forum? Say hello in this topic! Also make sure to read the rules.
Exposing a getter/setter for player energy
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
- JakSparro98
- Superfighter
- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 25
Exposing a getter/setter for player energy
Today we can access player's health by invoking it's inherited method from IObject, however currently is not possible to manipulate/read the stamina/energy value, pretty weird it wasn't planned in any way, am I missing something?
1 x
- Gurt
- Lead Programmer
- Posts: 1884
- Joined: Sun Feb 28, 2016 3:22 pm
- Title: Lead programmer
- Started SFD: Made it!
- Location: Sweden
- Gender:
- Age: 34
You can only activate infinite energy using modifiers per player or use the global /ie 1 command.
You can not update the stamina value as that wouldn't reliably be predictable by the client, causing a lot of problems. If there's not a getter for the stamina already I will try to add one for the next update.
Edit: ScriptAPI: Added IPlayer.GetEnergy(), IPlayer.GetMaxEnergy() to read current energy from a player (v.1.3.4)
You can not update the stamina value as that wouldn't reliably be predictable by the client, causing a lot of problems. If there's not a getter for the stamina already I will try to add one for the next update.
Edit: ScriptAPI: Added IPlayer.GetEnergy(), IPlayer.GetMaxEnergy() to read current energy from a player (v.1.3.4)
2 x
Gurt