Guest User

startDelivery2.sqf

a guest
Mar 11th, 2014
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. //initialise what bay and what type
  2. sleep 5;
  3. _reciever = _this select 0;
  4. _deliverbay = _this select 1;
  5. _acceptsType = _this select 2;
  6. _baypos = getMarkerPos _deliverbay;
  7. _bayx = _baypos select 0;
  8. _bayy = _baypos select 1;
  9. _bayz = _baypos select 2;
  10.  
  11. //check for delivery every 30s
  12. while {true} do
  13. {
  14.  
  15. player globalchat format["_acceptsType %1",_acceptsType];
  16. player globalchat format["_deliverbay %1",_deliverbay];
  17. player globalchat format["_baypos %1",_baypos];
  18. player globalchat format["_bayx %1",_bayx];
  19. player globalchat format["_bayy %1",_bayy];
  20. player globalchat format["_bayz %1",_bayz];
  21.  
  22.  
  23. //put all accepted objects within 5m of the bay in an array
  24. _goodsInbound = nearestObjects[[_bayx, _bayy, _bayz], _acceptsType, 5];
  25.  
  26. //errorchecking hints
  27. _total = count _goodsInbound;
  28. _cntsmallInbound = "Fort_Crate_wood" countType _goodsInbound; //count number of items in array
  29. _cntmediumInbound = "CargoCont_Net1_H" countType _goodsInbound;
  30. _cntlargeInbound = "Land_Misc_Cargo1E_EP1" countType _goodsInbound;
  31.  
  32.  
  33. player globalchat format["Small: %1 Med: %2 Large: %3, Total: %4, Dude: %5 Worth: %6 ", _cntsmallInbound, _cntmediumInbound, _cntlargeInbound, _total, _reciever, _inboundWorth ];
  34.  
  35. //ignore below until the list is working - work out worth of total delivered goods
  36. //_inboundWorth = 0;
  37. //_unitWorth = {_x getVariable _goodsWorth;} forEach _goodsInbound;
  38. //{deleteVehicle _x;} forEach _goodsInbound;
  39.  
  40.  
  41.  
  42. sleep 30; //the 30seconds bit
  43.  
  44. };
Add Comment
Please, Sign In to add comment