Blockland Forums > Modification Help

How to get "every" vehicle datablock

Pages: (1/4) > >>

MARBLE MAN:

I was working on something for EVERY vehicle, but this one statement stopped me:

--- Code: ---if(%mnt.getDatablock().getName() $= "VEHICLENAMEVehicle")
--- End code ---
I need help making the "VEHICLENAME" to be every vehicle. Is that possible?

Treynolds416:

if(%mnt.getClassname() $= "FlyingVehicle" || %mnt.getClassname() $= "WheeledVehicle")
    //Do stuff

You could also do
if(strStr(%mnt.getClassname(),"Vehicle") != -1)
    //Do stuff

MARBLE MAN:


--- Quote from: Treynolds416 on May 23, 2012, 05:41:32 PM ---if(%mnt.getClassname() $= "FlyingVehicle" || %mnt.getClassname() $= "WheeledVehicle")
    //Do stuff

You could also do
if(strStr(%mnt.getClassname(),"Vehicle") != -1)
    //Do stuff

--- End quote ---
1st one doesnt work..
2nd is fine!
Thanks!

Brian Smithers:


if(%mnt.getDatablock().getName() $= "TronLightBikeVehicle")

anyone see a similarity?

Treynolds416:


--- Quote from: Brian Smithers on May 23, 2012, 06:33:24 PM ---
if(%mnt.getDatablock().getName() $= "TronLightBikeVehicle")

anyone see a similarity?

--- End quote ---
Ofc

See the post I made in his other topic (I think it's about the planes though, not the bike)

Pages: (1/4) > >>

Go to full version