Jump to content

twlvbravo

Member
  • Content Count

    6
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About twlvbravo

  • Rank
    Rookie
  1. after veh is destroyed i want it to respawn in the same place as destroyed damaged with a timer for deserted vehicle...vehicle blows up, can anyone merge these two scripts and write the code for init? // by psycho // Evolution respawn script - vehicles spawn at place where there destroy'd and must be repair #include "setup.sqf" #define __Trans(tkind) _trans = getNumber(configFile >> #CfgVehicles >> typeOf _vec >> #tkind) private ["_vec","_class","_rtime","_gm"]; _vec = _this select 0; _class = typeOf _vec; _rtime = 0; if !(__A2only) then { _vec addMPEventhandler ["MPKilled", {if (isServer) then {_this call XffuelCheck}}]; }; _eng_reward = { if(time > _rtime) then { switch (true) do { case (_vec in list reng1) : {reng1 call EVO_Erew}; case (_vec in list reng2) : {reng2 call EVO_Erew}; case (_vec in list reng3) : {reng3 call EVO_Erew}; case (_vec in list reng4) : {reng4 call EVO_Erew}; default {}; }; _rtime = time + 600; }; }; while {true} do { waitUntil {!alive _vec || getDammage _vec > 0.8}; _pos = position _vec; _dir = getDir _vec; sleep (60 + random 60); deleteVehicle _vec; _vec = objNull; __sleep; _vec = createVehicle [_class, _pos, [], 0, "NONE"]; _vec setPos _pos; _vec setDir _dir; _vec setFuel 1; _vec setDammage 0.80; __sleep; _vec setVeloCity [0.1, 0, 0.05]; __Trans(transportAmmo); if (_trans > 0) then { _vec setAmmoCargo 0; }; __Trans(transportRepair); if (_trans > 0) then { _vec setRepairCargo 0; }; __Trans(transportFuel); if (_trans > 0) then { _vec setFuelCargo 0; }; ["d_n_v",_vec] call XNetCallEventToClients; waitUntil {damage _vec <= 0.05 || !(alive _vec)}; if (damage _vec <= 0.05) then { [] call _eng_reward; if (damage _vec <= 0.05) then { _fuelleft = _vehicle getVariable "vec_fuel"; if (isNil "_fuelleft") then {_fuelleft = 1}; _vec setFuel _fuelleft; if (!__A2only) then { _vec addMPEventhandler ["MPKilled", {if (isServer) then {_this call XffuelCheck}}]; }; [] call _eng_reward; __Trans(transportAmmo); if (_trans > 0) then { _vec setAmmoCargo 1; }; __Trans(transportRepair); if (_trans > 0) then { _vec setRepairCargo 1; }; __Trans(transportFuel); if (_trans > 0) then { _vec setFuelCargo 1; }; }; }; }; and simple respawn with timer after vic is blown up and has re spawned ========================================================= */ if (!isServer) exitWith {}; // Define variables _unit = _this select 0; _delay = if (count _this > 1) then {_this select 1} else {30}; _deserted = if (count _this > 2) then {_this select 2} else {120}; _respawns = if (count _this > 3) then {_this select 3} else {0}; _explode = if (count _this > 4) then {_this select 4} else {false}; _dynamic = if (count _this > 5) then {_this select 5} else {false}; _unitinit = if (count _this > 6) then {_this select 6} else {}; _haveinit = if (count _this > 6) then {true} else {false}; _hasname = false; _unitname = vehicleVarName _unit; if (isNil _unitname) then {_hasname = false;} else {_hasname = true;}; _noend = true; _run = true; _rounds = 0; if (_delay < 0) then {_delay = 0}; if (_deserted < 0) then {_deserted = 0}; if (_respawns <= 0) then {_respawns= 0; _noend = true;}; if (_respawns > 0) then {_noend = false}; _dir = getDir _unit; _position = getPosASL _unit; _type = typeOf _unit; _dead = false; _nodelay = false; // Start monitoring the vehicle while {_run} do { sleep (2 + random 10); if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true}; // Check if the vehicle is deserted. if (_deserted > 0) then { if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8)) then { _timeout = time + _deserted; sleep 0.1; waitUntil {_timeout < time or !alive _unit or {alive _x} count crew _unit > 0}; if ({alive _x} count crew _unit > 0) then {_dead = false}; if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; if !(alive _unit) then {_dead = true; _nodelay = false}; }; }; // Respawn vehicle if (_dead) then { if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;}; if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;}; if (_explode) then {_effect = "M_TOW_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;}; sleep 0.1; deleteVehicle _unit; sleep 2; _unit = _type createVehicle _position; _unit setPosASL _position; _unit setDir _dir; if (_haveinit) then {_unit setVehicleInit format ["%1;", _unitinit]; processInitCommands;}; if (_hasname) then {_unit setVehicleInit format ["%1 = this; this setVehicleVarName ""%1""",_unitname]; processInitCommands;}; _dead = false; // Check respawn amount if !(_noend) then {_rounds = _rounds + 1}; if ((_rounds == _respawns) and !(_noend)) then {_run = false;}; }; };
  2. i love your mission man, i host it all the time with several of my friends....however that being said, you cant please everyone. example..i leave a server up and come back on later and there are vic all over the map...i understand the point of it and i get it. It seems some ppl do not. so in the spirit of making everyone happy here is what i need help with. I would like to keep the vic respawn in its current state, but needs to have a timer on the disabled/deserted vic..like say 30 min on disabled and 1 hr on deserted vics, i dont know how to write scripts, i have made some adjustments but its just not what im looking for..can i get any good advice, maybe adding in simple spawn script to the respawned vic init, so that i can control the timers??
  3. im trying to modify hohei evo v2.07..the vics dont respawn you have to fix them. alot of ppl that play this with me dont really like it. trying to use your simple repawn to set a time limit on the respawn..like vic blows up..cant get to it and repair it in say..30 min it repawns. or if you leave it unattended for an hour it respawns. ive got all that down however it all changes when you blow up a vic, script respawns a new on but leaves the old, after old is repaired, vic does not get removed after being unattended. can you test this an see if we can find a cure??
  4. im trying to modify hohei evo v2.07..the vics dont respawn you have to fix them. alot of ppl that play this with me dont really like it. trying to use your simple repawn to set a time limit on the respawn..like vic blows up..cant get to it and repair it in say..30 min it repawns. or if you leave it unattended for an hour it respawns. ive got all that down however it all changes when you blow up a vic, script respawns a new on but leaves the old, after old is repaired, vic does not get removed after being unattended. can you test this an see if we can find a cure??
  5. im trying to modify hohei evo v2.07..the vics dont respawn you have to fix them. alot of ppl that play this with me dont really like it. trying to use your simple repawn to set a time limit on the respawn..like vic blows up..cant get to it and repair it in say..30 min it repawns. or if you leave it unattended for an hour it respawns. ive got all that down however it all changes when you blow up a vic, script respawns a new on but leaves the old, after old is repaired, vic does not get removed after being unattended. can you test this an see if we can find a cure??
  6. im trying to modify hohei evo v2.07..the vics dont respawn you have to fix them. alot of ppl that play this with me dont really like it. trying to use your simple repawn to set a time limit on the respawn..like vic blows up..cant get to it and repair it in say..30 min it repawns. or if you leave it unattended for an hour it respawns. ive got all that down however it all changes when you blow up a vic, script respawns a new on but leaves the old, after old is repaired, vic does not get removed after being unattended. can you test this an see if we can find a cure??
×