This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

startDelivery.sqf

By: a guest on Mar 11th, 2014  |  syntax: None  |  size: 1.06 KB  |  views: 50  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //initialise who, what bay and what type
  2. _reciever = _this select 0;
  3. _deliverbay = _this select 1;
  4. _acceptsType = _this select 2;
  5.  
  6. //check for delivery every 30s
  7. while {true} do
  8. {
  9.        
  10.         //put all accepted objects within 5m of the bay in an array
  11.         _goodsInbound = nearestObjects[getMarkerPos _deliverbay, _acceptsType, 5];
  12.        
  13.         //errorchecking hints
  14.         _total = count _goodsInbound;  
  15.         _cntsmallInbound = "Fort_Crate_wood" countType _goodsInbound;   //count number of items in array
  16.         _cntmediumInbound = "CargoCont_Net1_H" countType _goodsInbound;
  17.         _cntlargeInbound = "Land_Misc_Cargo1E_EP1" countType _goodsInbound;
  18.        
  19.  
  20.        
  21.         hint format["Small: %1 Med: %2 Large: %3, Total: %4, Dude: %5 Worth: %6 ", _cntsmallInbound, _cntmediumInbound, _cntlargeInbound, _total, _reciever, _inboundWorth ];
  22.        
  23.         //ignore below until the list is working - work out worth of total delivered goods
  24.         //_inboundWorth = 0;
  25.         //_unitWorth = {_x getVariable _goodsWorth;} forEach _goodsInbound;
  26.         //{deleteVehicle _x;} forEach _goodsInbound;
  27.        
  28.        
  29.        
  30.         sleep 30;   //the 30seconds bit
  31.  
  32. };
clone this paste RAW Paste Data