Author Topic: Get a List of All Installed Items or Vehicles  (Read 839 times)

Is there any way that I can get a space- or tab-delimited list of all installed items or vehicles?

Upon further inspection, I have found that I can iterate through DataBlockGroup to find all weapons and vehicles. Does anyone know of a more efficient way?

client or server sided?

client or server sided?
My guess is finding both client and server mods serverside

client or server sided?
Server-sided. Using DataBlockGroup works fine, but I wouldn't be suppressed if there were a more efficient way.

Server-sided. Using DataBlockGroup works fine, but I wouldn't be suppressed if there were a more efficient way.
you could run through base/server/ADD-ON-LIST.cs
or maybe it's in config/server/ADD-ON-LIST.cs

you could run through base/server/ADD-ON-LIST.cs
or maybe it's in config/server/ADD-ON-LIST.cs
The issue is that that would not be able to find vehicles which were added while the server was running.

Server-sided. Using DataBlockGroup works fine, but I wouldn't be suppressed if there were a more efficient way.

Code: [Select]
for(%i=0;%i<DatablockGroup.getCount();%i++) {
%w = DatablockGroup.getObject(%i);
if(%w.getClassName() $= "ItemData" && %w.uiName !$= "") {
}
else if(%w.getClassName() $= "VehicleData" && %w.uiName !$= "") {
}
}
I don't see how you can get more efficient than that. Only four lines of code. :s

Code: [Select]
for(%i=0;%i<DatablockGroup.getCount();%i++) {
%w = DatablockGroup.getObject(%i);
if(%w.getClassName() $= "ItemData" && %w.uiName !$= "") {
}
else if(%w.getClassName() $= "VehicleData" && %w.uiName !$= "") {
}
}
I don't see how you can get more efficient than that. Only four lines of code. :s
efficiency in typing, maybe
but not in actualy executing it

efficiency in typing, maybe
but not in actualy executing it
How did I interpret efficient that way. My bad, guess I'm thinking correctly today.

Code: [Select]
%c = DatablockGroup.getCount();
for(%i=0;%i<%c;%i++)
{
%w = DatablockGroup.getObject(%i);
if(%w.getClassName() $= "ItemData" && %w.uiName !$= "")
        {
                  //code here
}
else if(%w.getClassName() $= "VehicleData" && %w.uiName !$= "")
        {
                  //code here
}
}
this way your not calling datablockgroup.getcount(); hundreds of times