| Blockland Forums > Modification Help |
| Get a List of All Installed Items or Vehicles |
| << < (2/3) > >> |
| Lugnut:
--- Quote from: TheRealMint on April 03, 2012, 09:19:21 PM ---Server-sided. Using DataBlockGroup works fine, but I wouldn't be suppressed if there were a more efficient way. --- End quote --- you could run through base/server/ADD-ON-LIST.cs or maybe it's in config/server/ADD-ON-LIST.cs |
| TheRealMint:
--- Quote from: Lugnut1206 on April 03, 2012, 09:26:39 PM ---you could run through base/server/ADD-ON-LIST.cs or maybe it's in config/server/ADD-ON-LIST.cs --- End quote --- The issue is that that would not be able to find vehicles which were added while the server was running. |
| Daenth:
--- Quote from: TheRealMint on April 03, 2012, 09:19:21 PM ---Server-sided. Using DataBlockGroup works fine, but I wouldn't be suppressed if there were a more efficient way. --- End quote --- --- Code: ---for(%i=0;%i<DatablockGroup.getCount();%i++) { %w = DatablockGroup.getObject(%i); if(%w.getClassName() $= "ItemData" && %w.uiName !$= "") { } else if(%w.getClassName() $= "VehicleData" && %w.uiName !$= "") { } } --- End code --- I don't see how you can get more efficient than that. Only four lines of code. :s |
| phflack:
--- Quote from: Daenth on April 04, 2012, 06:54:46 PM --- --- Code: ---for(%i=0;%i<DatablockGroup.getCount();%i++) { %w = DatablockGroup.getObject(%i); if(%w.getClassName() $= "ItemData" && %w.uiName !$= "") { } else if(%w.getClassName() $= "VehicleData" && %w.uiName !$= "") { } } --- End code --- I don't see how you can get more efficient than that. Only four lines of code. :s --- End quote --- efficiency in typing, maybe but not in actualy executing it |
| Daenth:
--- Quote from: phflack on April 04, 2012, 10:07:37 PM ---efficiency in typing, maybe but not in actualy executing it --- End quote --- How did I interpret efficient that way. My bad, guess I'm thinking correctly today. |
| Navigation |
| Message Index |
| Next page |
| Previous page |