(info) Other great resources: Official JS API docs, Scripting Forum

donatePower()

Transfer some power to another player...

Hopefully this function will be renamed transferPower() and be given an associated event.

 

Syntax

var success = donatePower(amount, to);

Parameters

ParameterTypeMandatoryNotesGame Version
amount

Number

(tick)

The amount of oil to transfer.

You must ensure you have enough power available first!

3.2
toNumber(tick)

The ID of the player who you want to transfer the object to.

3.2

Return value

ValueTypeNotesGame Version
trueBooleanThe power was successfully transferred.3.2
falseBooleanYou do not have enough power to transfer the desired amount.3.2
<error>ErrorInvalid parameters or player not found.3.2

Notes

You can determine the amount of power a player has using playerPower().

Example

Transfer ¼ of my power to player 3...
var myPower = playerPower(me); 
donatePower( Math.floor(myPower/4), 3 );
Availability 3.2+

Requires:

  • Warzone 3.2 or above
Contents

Jump to:

See also

Related articles:

Â