Blockland Forums > Modification Help
Player Energy Problem
<< < (2/2)
Red_Guy:

--- Quote from: RedGajin on June 16, 2010, 07:17:17 PM ---Ok i tried getstateRecovery and that doesn't work either.


--- Code: ---function PlayerQuakeArmor::onnoEnergy(%client, %obj)
{
%obj.getstateRecover
}##

--- End code ---
The bracket seems to be the problem. i tried putting ; after it, still the same problem. Any solutions?

--- End quote ---

Maybe something like this?

--- Code: ---function PlayerQuakeArmor::onnoEnergy(%client, %obj)
{
%obj.getstateRecover();
}

--- End code ---

im guessing getstateRecover is a function, and functions need () and a ;

weather that will actually run and work.. i cant say, but it should compile fine
RedGajin:
Yeah, it got rid of the error report, thanks for that, but the player didn't go into recover mode after that.

--- Code: ---//quakePlayer.cs

//a new player datablock with quake-like movement



datablock PlayerData(PlayerQuakeArmor : PlayerStandardArmor)
{
   runForce = 1000 * 900;
   runEnergyDrain = 0.2;
   minRunEnergy = 1;
   maxForwardSpeed = 5.5;
   maxBackwardSpeed = 3;
   maxSideSpeed = 2.5;

   maxForwardCrouchSpeed = 3;
   maxBackwardCrouchSpeed = 2;
   maxSideCrouchSpeed = 1;

   jumpForce = 9 * 90; //8.3 * 90;
   jumpEnergyDrain = 20;
   minJumpEnergy = 1;
   jumpDelay = 40000;

minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;

rechargeRate = 0.04;
rechargeDelay = 40000;

uiName = "Quake-Like Player";
showEnergyBar = true;

   runSurfaceAngle  = 55;
   jumpSurfaceAngle = 55;
};
function PlayerQuakeArmor::onDamage(%client, %obj)
{
commandToClient(%obj.client,'bottomPrint',"\c6Damage Level: \c3" @ %obj.getDamageLevel() @ "%", 3);
parent::onDamage(%client, %obj);
}
function PlayerQuakeArmor::onnoEnergy(%obj)
{
%obj.getstateRecover();
}
--- End code ---

Maybe the onnoEnergy(%obj) isn't a function
Yeah, the onnoEnergy is definitely not a function. I tried %obj.deactivateDirectInput(); and that didn't work. Unless i can't control that from inside a script?
Navigation
Message Index
Previous page

Go to full version