Author Topic: [coding help] How to get a list of all weapon ids?  (Read 569 times)

trying to create an event that will spawn a random item from the servers list of items.  tried to search for help but the merge kinda forgets it all up.  I don't know how to get a list of the weapon ids on the server

The wrench system probably has these stored in a global array somewhere, but I don't know what it's called. Though it's pretty easy to just generate your own list of items.


%count = datablockGroup.getCount();
%found = 0;
for(%i = 0; %i < %count; %i++)
{
   %data = datablockGroup.getObject(%i);
   if(%data.getClassName() $= "ItemData")
   {
      $itemDatablocks[%found] = %data;
      %found++;
   }
}
$itemDatablockCount = %found;