ARMA 3 / A2 OPERATION ARROWHEAD / ARMA2 / Serwery: artur_PL

Administrator forum: Artur Dębski Skype: arturdebski Steam: arturdebski Serwery artur-PL - Gracze - Mody - Mapy - Sprzęt do grania
Teraz jest Wt maja 14, 2024 1:56 am

Strefa czasowa: UTC + 1 [ DST ]




Utwórz nowy wątek Odpowiedz w wątku  [ Posty: 1 ] 
Autor Wiadomość
PostNapisane: N paź 30, 2011 12:28 pm 
Offline

Dołączył(a): Pt sie 12, 2011 9:31 pm
Posty: 313
Lokalizacja: Warszawa
Użycie w Multi-Session Operations v3.45;
0 = [this, 14400] execVM "support\scripts\resupply.sqf";

Kod:
/* 
=========================================================
Based on Simple Vehicle Respawn Script v1.6
by Tophe of �stg�ta Ops [OOPS]

Put this in the vehicles init line:
veh = [this, Delay] execVM "respawn.sqf"

Default respawn delay is 30 seconds, to set a custom
respawn delay time, put that in the init as well.
Like this:
veh = [this, 15] execVM "respawn.sqf"

=========================================================
*/

private ["_hasname","_delay","_unit","_weapons","_mags","_unitname","_dir","_position","_type","_max","_run"];
if (!isServer) exitWith {};

// Define variables
_unit = _this select 0;
_delay = if (count _this > 1) then {_this select 1} else {30};

_hasname = false;
_unitname = vehicleVarName _unit;
if (_unitname == "") then {_hasname = false;} else {_hasname = true;};
_run = true;

if (_delay < 0) then {_delay = 0};

_dir = getDir _unit;
_position = getPosASL _unit;
_type = typeOf _unit;
_weapons = getWeaponCargo _unit;
_mags = getMagazineCargo _unit;

// Start monitoring the vehicle
while {_run} do {   
      sleep _delay;      
      if(getPosASL _unit distance _position > 10) then {
         _unit = _type createVehicle _position;
         _unit setPosASL _position;
         _unit setDir _dir;
         if (_hasname) then {
               _unit setVehicleVarName _unitname;
         };
      };
        clearWeaponCargo _unit;
        clearMagazineCargo _unit;
       
        _max = count(_weapons select 0);
        for "_i" from 0 to _max do {
                _unit addWeaponCargo [(_weapons select 0) select _i, (_weapons select 1) select _i];
        };
       
        _max = count(_mags select 0);
        for "_i" from 0 to _max do {
                _unit addMagazineCargo [(_mags select 0) select _i, (_mags select 1) select _i];
        };       
};


Załączniki:
resupply.zip [813 Bajtów]
Pobrane 161 razy

_________________
Artur Dębski
http://blogit.one.pl
Góra
 Zobacz profil  
 
Wyświetl posty nie starsze niż:  Sortuj wg  
Utwórz nowy wątek Odpowiedz w wątku  [ Posty: 1 ] 

Strefa czasowa: UTC + 1 [ DST ]


Kto przegląda forum

Użytkownicy przeglądający ten dział: Brak zidentyfikowanych użytkowników i 1 gość


Nie możesz rozpoczynać nowych wątków
Nie możesz odpowiadać w wątkach
Nie możesz edytować swoich postów
Nie możesz usuwać swoich postów
Nie możesz dodawać załączników

Szukaj:
Skocz do:  
cron
Powered by phpBB® Forum Software © phpBB Group
Przyjazne użytkownikom polskie wsparcie phpBB3 - phpBB3.PL