Jump to content

drsgfire

Member
  • Content Count

    4
  • Joined

  • Last visited

  • Medals

Posts posted by drsgfire


  1. here you go (from our arma2 missions)

    //in mission.sqm
    class Sensors
    {
    	items=3;
    	class Item0
    	{
    		position[]={4619.7158,0.19623651,-1617.5906};
    		timeoutMin=1;
    		timeoutMid=1;
    		timeoutMax=1;
    		interruptable=1;
    		age="UNKNOWN";
    		text="pinit";
    		name="pinit";
    		expCond="local player";
    		expActiv="plays = [] execVM ""scripts\pinit.sqf"";";
    		class Effects
    		{
    		};
    	};
    	class Item1
    	{
    		position[]={9645.6133,13,2998.0623};
    		a=400;
    		b=180;
    		angle=90;
    		rectangular=1;
    		activationBy="ANY";
    		age="UNKNOWN";
    		text="airport";
    		name="AirportIn";
    		class Effects
    		{
    		};
    	};
    	class Item2
    	{
    		position[]={8441.6699,678.59814,10571.127};
    		a=40;
    		b=40;
    		angle=50;
    		activationBy="WEST";
    		repeating=1;
    		interruptable=1;
    		age="UNKNOWN";
    		name="farp1";
    		class Effects
    		{
    		};
    	};
    };
    };
    
    

    make a folder in your mission folder called "scripts" and place these into it

    //scripts\pinit.sqf
    _cthread = [] execVM "scripts\MainThreadC.sqf";
    //and any other player clientside scripts you care to run at player join
    

    //scripts\mainthreadC.sqf
    EGG_EVO_Repair = 
    {
    _vec = (vehicle player);
    _type = typeOf vehicle player;
    
    if(getDammage _vec > 0 or fuel _vec < 0.98 and not (_vec isKindOf "Man")) then
    {
    	_inrepairzone = ((_vec in list AirportIn) or (_vec in list farp1) );//your sensor zones in the mission named "Airportin" or "farp1" etc
    	if(((_vec in list AirportIn) or (_vec in list farp1) ) and _vec != player and speed _vec > -2 and speed _vec < 2 and position _vec select 2 < 2.0 and (local _vec)) then
    	{
    		 titleText [localize "STR_M04t83", "PLAIN DOWN",0.3];
    		 for [{_loop2=0}, {_loop2<1}, {_loop2=_loop2}] do
    		 {
    		    sleep 0.200;	    		    
    		    if (getDammage _vec > 0) then {_vec setDammage ((getDammage _vec)-0.0125);};
    		    if (Fuel _vec < 1) then {_vec setFuel ((Fuel _vec)+0.0125);};
    		    if (getDammage _vec == 0 and Fuel _vec == 1) then {_loop2=1;};
    		    if(_vec != vehicle player or speed _vec < -2 or speed _vec > 2 or position _vec select 2 > 2.0) then {_loop2=1;titleText [localize "STR_M04t84", "PLAIN DOWN",0.3];};
    		    _dam = (getDammage _vec)*100;
    		    _ful = (Fuel _vec)*100;
    		    hint format["Damage: %1\nFuel: %2",Round _dam,Round _ful];
    		};
    		_vec setVehicleAmmo 1;	
    	};
    };
    };
    
    for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
    {
    [] call EGG_EVO_Repair;
    sleep 1.01;
    };
    
    

    this is the standard repair/refuel/rearm function for Arma1 and2 for us

    just go into your mission in the editor and move the trigger/sensors about until they are where you want them

    i'll be polishing this up for use at all fuel stations too soon (repair not rearm!)

    Alright. So I did this and it is working. One question though... what does the pinit do? Also is there a way to slow the refueling process down a tad?

×