Jump to content
  • 0

Building Recipe for Energy?


Ctrl-Alt-Rage

Question

4 answers to this question

Recommended Posts

  • 0

I use this to give energy when in range of a friendly jammer:

while {true} do 
{
	uiSleep 60;
	{ if ( (_x getVariable ["BUILD_OWNER", "-1"]) in [getPlayerUID player, Epoch_my_GroupUID] ) then 
		{
			//In range of your own jammer boost energy gain
			if(EPOCH_playerEnergy < 2000) then
			{
				EPOCH_playerEnergy = EPOCH_playerEnergy + 50;
				systemchat("Jammer boosted energy: You have just received 50 Energy");
			};				
		}; 
	} forEach nearestObjects [player, ["PlotPole_EPOCH"], 225];
};
Link to comment
Share on other sites

  • 0

Save the above code in your mission file as EnergyBoost.sqf and in your init.sqf put :
 

if (!isDedicated and hasInterface) then 
{
	// EnergyBoost
	[] execVM "EnergyBoost.sqf";
	systemchat("EnergyBoost activated...");	
};
 

Just be careful if you adjust the max amount it gives you as if you try to make it go over 2500 energy infiSTAR will ban you (not sure about the stock AH). That's why I limited it to 2000

Link to comment
Share on other sites

  • 0

why not trying something like this:

while {true} do
{
    uiSleep 60;

        { if ( (_x getVariable ["BUILD_OWNER", "-1"]) in [getPlayerUID player, Epoch_my_GroupUID] ) then
            {
                //In range of your own jammer boost energy gain
                if((EPOCH_playerEnergy < 2000) && (!(EPOCH_playerEnergy >= 2450))) then
                {
                    EPOCH_playerEnergy = EPOCH_playerEnergy + 50;
                    systemchat("Jammer boosted energy: You have just received 50 Energy");
                };                
            };
        } forEach nearestObjects [player, ["PlotPole_EPOCH"], 225];
    
    
};
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...