Author Topic: Mount Item  (Read 5296 times)

Worked fine for me.

That's because you don't know what form of bugs to look for in code.

you're kidding me right

there are other far better means of doing this


instead, try and make a function that finds a weapon by its ui name, instead of literally taking the input and putting "image" at the end.

This works just fine for me, if you're not satisfied edit it to your liking.

This works just fine for me, if you're not satisfied edit it to your liking.
This won't work for FIFTEEN METRIC forgetTON of weapons.

This won't work for FIFTEEN METRIC forgetTON of weapons.
what happens when you enter a weapon that doesn't exist?

what happens when you enter a weapon that doesn't exist?
you blow up

What if you wanna mount a Minigun, but some noob made it and the image name is MinigunA2CXs4.

then type /mount MinigunA2CXs4

then type /mount MinigunA2CXs4
Aha, but it isn't MinigunA2CXs4image.

Anyway, here's a function to find datablocks by their ui name.

Code: [Select]
function FindDatablockByUIName(%name, %class)
{
for(%i = 0; %i < DataBlockGroup.getCount(); %i++)
{
%obj = DataBlockGroup.getObject(%i);
if(%name $= %obj.uiname && ((striPos(%class, %obj.getClassName()) != -1 && %class !$= "") || %class $= ""))
return %obj;
}
return -1;
}
« Last Edit: May 01, 2012, 07:15:32 PM by otto-san »

Aha, but it isn't MinigunA2CXs4image.

/mount rocketlauncher

OP used this as the example, so I assumed, and the image name doesn't have to include "image".

OP used this as the example, so I assumed, and the image name doesn't have to include "image".

It doesn't...
« Last Edit: May 02, 2012, 04:31:03 AM by 420 »

didn't they already make one of these? I think it was like, /arm *weapon*

didn't they already make one of these? I think it was like, /arm *weapon*

Yeah, I used to use it whilst testing out an edit of the subway build by what's-his-face.

I would find an error or misplaced weapon blah blah blah,

then I'd /arm weapon so that I don't have to edit the minigame or lose my weapons every single time.

I was new to blockland back then though.

Sort of.

didn't they already make one of these? I think it was like, /arm *weapon*


as I recall, it was made by Tezuni and was only for default items.