allDead – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Killzone Kid" to "Killzone_Kid")
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Can use a server game logic to create your own simple garbage collector
Can use a server game logic to create your own simple garbage collector


<code>
<code style="display: block">if (!isServer || !isDedicated) exitWith {};
if (!isServer || !isDedicated) exitWith {};
while {isDedicated} do
while {isDedicated} do
{
{
Line 13: Line 12:
};</code>
};</code>


== Returned array appears to be sorted by distance ==
== Returned array distance sorting ==


The returned array appears to be sorted by distance from the player. The closest dead body will be first and the farthest away will be last in the array. So the returned order will change based on the player's position. Tested in A2OA 1.63.131129 [[User:Ebay|Ebay]] ([[User talk:Ebay|talk]]) 20:23, 29 October 2016 (CEST)
Is the returned array sorted by distance from the player? [[User:Ebay|Ebay]] ([[User talk:Ebay|talk]]) 20:23, 29 October 2016 (CEST)
::If there is an order, it is coincidental, no sorting is performed deliberately [[User:Killzone_Kid|Killzone_Kid]] ([[User talk:Killzone_Kid|talk]]) 20:37, 29 October 2016 (CEST)

Latest revision as of 13:48, 12 March 2024

Can use a server game logic to create your own simple garbage collector

if (!isServer || !isDedicated) exitWith {}; while {isDedicated} do {

 _list = allDead;
 for {_i = 0; _i < count _list; _i = _i + 1} do
 {
   deleteVehicle _x;
 };
 sleep 600; // Cleans server every 10 minutes

};

Returned array distance sorting

Is the returned array sorted by distance from the player? Ebay (talk) 20:23, 29 October 2016 (CEST)

If there is an order, it is coincidental, no sorting is performed deliberately Killzone_Kid (talk) 20:37, 29 October 2016 (CEST)