Kod: Zaznacz cały
hel = _this select 0;publicvariable "hel";
carr = _this select 1;publicvariable "carr";
? hel == h1: skrz=s1;publicvariable "skrz";
? hel == h2: skrz=s2;publicvariable "skrz";
? hel == h3: skrz=s3;publicvariable "skrz";
? hel == h4: skrz=s4;publicvariable "skrz";
? hel == h5: skrz=s5;publicvariable "skrz";
? hel == h6: skrz=s6;publicvariable "skrz";
? hel == h7: skrz=s7;publicvariable "skrz";
? hel == h8: skrz=s8;publicvariable "skrz";
? hel == h9: skrz=s9;publicvariable "skrz";
? hel == h10: skrz=s10;publicvariable "skrz";
akcja = "skrzynka";publicvariable "akcja";
exit
teraz gdy akcja bedzie równa skrzynka czy coś innego odpali się(za pomocą triggera(wyzwalacza), one jakoś tak globalnie działają):
Kod: Zaznacz cały
goto format["%1",akcja]
#exit
akcja="zero"; publicvariable "akcja"
exit
#skrzynka
[skrz,carr,hel] exec "podnies.sqs"
goto "exit"
#wyladuj
[veh,ilosc] exec "wywal.sqs"
goto "exit"
Kod: Zaznacz cały
_obj = _this select 0
_car = _this select 1
_h = _this select 2
_cel = woz
_cel2 = woz2
? _car in carriers:hint "masz zajete rece";exit;
? behaviour _car == "safe" :goto "before";
_car playmove "combattostand"
_car setbehaviour "safe"
hint "nie masz sily, sprobuj za chwile"
exit
#before
_h removeaction banan
carriers = carriers + [_car]; publicvariable "carriers"
#loop
? speed _car > 6 OR !(alive _car) OR (behaviour _car != "safe") : goto "wywal"
? _obj distance _cel < 2.5 : goto "doniesione"
? _obj distance _cel2 < 2.5 : goto "doniesione2"
;? ((time - _t)> 15) && (behaviour _car != "safe") : exit
_dir = getdir _car
_posstart = getpos _car
_ox = GetPos _car Select 0
_oy = GetPos _car Select 1
_pos = [_ox+sin(_dir)*(0.9),_oy+cos(_dir)*(0.9),0.75]
_obj setpos _pos
_obj setdir (_dir+90)
~0.01
goto "loop"
#wywal
_ox = GetPos _obj Select 0
_oy = GetPos _obj Select 1
_pos = [_ox,_oy,0]
_obj setpos _pos
banan = _h addaction ["podnies","podniesakcja.sqs"]
carriers = carriers - [_car]; publicvariable "carriers"
exit
#doniesione
woz1ban = woz1ban + 1; publicvariable "woz1ban"
goto "p"
#doniesione2
woz2ban = woz2ban + 1; publicvariable "woz2ban;
#p
_obj setpos [0,0,0]
banzeb = banzeb + [_obj]; publicvariable "banzeb";
hint format["doniesione skrzynki:%1/10",count banzeb]
carriers = carriers - [_car]
banan = _h addaction ["podnies","podniesakcja.sqs"]
exit
teraz tak.
ten hint format["doniesione skrzynki:%1/10",count banzeb] nie wyswietla się nikomu innemu jak tylko temu co odpali tę akcję.
a jest to sprawa kluczowa, żeby macierz banzeb była dostępna dla każdego, a nie jest, pomimo publicvariable.
proszę o propozycje rozwiązania problemu.
/* --------------------------------------------------------- */
problem drugi
Kod: Zaznacz cały
? !(local Server): exit
_n=0
_rp = (_this select 1) + (random 10)
_r = _rp - (_rp mod 1)
_obj = _this select 0
#loop
?_n==_r: exit
_r1 = random 5
_r2 = 1 - random _r1
_pos = [(getpos _obj select 0) + _r1, (getpos _obj select 1) - _r2, 0]
_ban = "weaponholder" createVehicle _pos
_ban setpos _pos
_ban setdir (random 360)
banust = banust + [_ban]; publicvariable "banust";
_n=_n+1
goto "loop"
exit
potem dla macierzy banust odpalam(z triggera). (banust exec "banany.sqs")
Kod: Zaznacz cały
_n = 0
#loop
? _n >= (count _this): exit
(_this select _n) addmagazinecargo ["AS_banana",1]
_n = _n + 1
goto "loop"
no i to by było na tyle.
aha, to jest pod ofp jeszcze, ale pod armą powinno być tak samo.