killshot
22.08.2014, 15:49
Moin, moin.
Ich habe für eine MP-Mission als Startlocation ein kleines Biwak (hauptsächlich aus den interaktiven Schlafsäcken/Rallypoints) erstellt und möchte jetzt gerne, dass der jeweilige Schlafsack (rp1 bis rp12) nur dann sichtbar (hideObjectGlobal) ist, wenn der dazugehörige Spieler (s1 bis s12) auch tatsächlich auf dem Server ist. Also wenn beispielweise alle Slots bis auf s11 und s12 belegt sind, sollen eben auch nur rp1 bis rp10 sichtbar sein.
Ich hatte es jetzt in meiner init.sqf folgendermaßen probiert.
if (!isNull s1) then {if (s1 == player) then {rp1 hideObjectGlobal false;} else {rp1 hideObjectGlobal true;};};
if (!isNull s2) then {if (s2 == player) then {rp2 hideObjectGlobal false;} else {rp2 hideObjectGlobal true;};};
if (!isNull s3) then {if (s3 == player) then {rp3 hideObjectGlobal false;} else {rp3 hideObjectGlobal true;};};
if (!isNull s4) then {if (s4 == player) then {rp4 hideObjectGlobal false;} else {rp4 hideObjectGlobal true;};};
if (!isNull s5) then {if (s5 == player) then {rp5 hideObjectGlobal false;} else {rp5 hideObjectGlobal true;};};
if (!isNull s6) then {if (s6 == player) then {rp6 hideObjectGlobal false;} else {rp6 hideObjectGlobal true;};};
if (!isNull s7) then {if (s7 == player) then {rp7 hideObjectGlobal false;} else {rp7 hideObjectGlobal true;};};
if (!isNull s8) then {if (s8 == player) then {rp8 hideObjectGlobal false;} else {rp8 hideObjectGlobal true;};};
if (!isNull s9) then {if (s9 == player) then {rp9 hideObjectGlobal false;} else {rp9 hideObjectGlobal true;};};
if (!isNull s10) then {if (s10 == player) then {rp10 hideObjectGlobal false;} else {rp10 hideObjectGlobal true;};};
if (!isNull s11) then {if (s11 == player) then {rp11 hideObjectGlobal false;} else {rp11 hideObjectGlobal true;};};
if (!isNull s12) then {if (s12 == player) then {rp12 hideObjectGlobal false;} else {rp12 hideObjectGlobal true;};};Im Editor funktionierts, auf einem DediServer leider nicht.
Ein Kollege hatte dann noch folgenden Lösungsvorschlag, der bis jetzt leider auch nicht hingehauen hat:
_arr_players = [ [s1,rp1],[s2,rp2],[s3,rp3],[s4,rp4],[s5,rp5],[s6,rp6],[s7,rp7],[s8,rp8],[s9,rp9],[s10,rp10],[s11,rp11],[s12,rp12] ];
for [{ _i = 0 }, { _i < count(_arr_players) }, { _i = _i +1 }] do
{
player groupchat format["Loop with index #%1",_i];
if ( !isNil( (_arr_players select _i) select 0 ) && (player == ((_arr_players select _i) select 0)) ) then
{
player groupchat format["Player %1 is equal",(_arr_players select _i) select 0];
(_arr_players select _i) select 1 hideObjectGlobal false;
} else { player groupchat format["Player %1 is not equal",(_arr_players select _i) select 0]; (_arr_players select _i) select 1 hideObjectGlobal true; };
};Kann da vielleicht jemand eine helfende Hand reichen?
Danke und Grüße
Edit: Hatte eine falsche Überschrift sorry
Ich habe für eine MP-Mission als Startlocation ein kleines Biwak (hauptsächlich aus den interaktiven Schlafsäcken/Rallypoints) erstellt und möchte jetzt gerne, dass der jeweilige Schlafsack (rp1 bis rp12) nur dann sichtbar (hideObjectGlobal) ist, wenn der dazugehörige Spieler (s1 bis s12) auch tatsächlich auf dem Server ist. Also wenn beispielweise alle Slots bis auf s11 und s12 belegt sind, sollen eben auch nur rp1 bis rp10 sichtbar sein.
Ich hatte es jetzt in meiner init.sqf folgendermaßen probiert.
if (!isNull s1) then {if (s1 == player) then {rp1 hideObjectGlobal false;} else {rp1 hideObjectGlobal true;};};
if (!isNull s2) then {if (s2 == player) then {rp2 hideObjectGlobal false;} else {rp2 hideObjectGlobal true;};};
if (!isNull s3) then {if (s3 == player) then {rp3 hideObjectGlobal false;} else {rp3 hideObjectGlobal true;};};
if (!isNull s4) then {if (s4 == player) then {rp4 hideObjectGlobal false;} else {rp4 hideObjectGlobal true;};};
if (!isNull s5) then {if (s5 == player) then {rp5 hideObjectGlobal false;} else {rp5 hideObjectGlobal true;};};
if (!isNull s6) then {if (s6 == player) then {rp6 hideObjectGlobal false;} else {rp6 hideObjectGlobal true;};};
if (!isNull s7) then {if (s7 == player) then {rp7 hideObjectGlobal false;} else {rp7 hideObjectGlobal true;};};
if (!isNull s8) then {if (s8 == player) then {rp8 hideObjectGlobal false;} else {rp8 hideObjectGlobal true;};};
if (!isNull s9) then {if (s9 == player) then {rp9 hideObjectGlobal false;} else {rp9 hideObjectGlobal true;};};
if (!isNull s10) then {if (s10 == player) then {rp10 hideObjectGlobal false;} else {rp10 hideObjectGlobal true;};};
if (!isNull s11) then {if (s11 == player) then {rp11 hideObjectGlobal false;} else {rp11 hideObjectGlobal true;};};
if (!isNull s12) then {if (s12 == player) then {rp12 hideObjectGlobal false;} else {rp12 hideObjectGlobal true;};};Im Editor funktionierts, auf einem DediServer leider nicht.
Ein Kollege hatte dann noch folgenden Lösungsvorschlag, der bis jetzt leider auch nicht hingehauen hat:
_arr_players = [ [s1,rp1],[s2,rp2],[s3,rp3],[s4,rp4],[s5,rp5],[s6,rp6],[s7,rp7],[s8,rp8],[s9,rp9],[s10,rp10],[s11,rp11],[s12,rp12] ];
for [{ _i = 0 }, { _i < count(_arr_players) }, { _i = _i +1 }] do
{
player groupchat format["Loop with index #%1",_i];
if ( !isNil( (_arr_players select _i) select 0 ) && (player == ((_arr_players select _i) select 0)) ) then
{
player groupchat format["Player %1 is equal",(_arr_players select _i) select 0];
(_arr_players select _i) select 1 hideObjectGlobal false;
} else { player groupchat format["Player %1 is not equal",(_arr_players select _i) select 0]; (_arr_players select _i) select 1 hideObjectGlobal true; };
};Kann da vielleicht jemand eine helfende Hand reichen?
Danke und Grüße
Edit: Hatte eine falsche Überschrift sorry