Everything's working now. Thanks peeps.(Note: I am aware that there was a similar topic made back in 2009. However this is still a problem)
Title says it all. I can't find a way to get the vehicle that a vehicle spawn brick owns.
Now, before you say
%brick.vehicle
%brick.vehicleDatablock
Doing that returns an empty string, both in the console (%brick being replaced with the spawn bricks' id) and in code. Same with
%brick.getDatablock().vehicle
%brick.getDatablock().vehicleDatablock
Here's part of the script, where %brick = a fxDTSBrick.
echo(%brick.getId()); //Returns the spawn bricks' id
echo(%brick.getClassName()); //Returns fxDTSBrick
echo(%brick.vehicle); //Returns an empty string
echo(%brick.vehicleDatablock); //Returns an empty string
If it helps, the code 'seemed' to work after about 20 minutes in single player, and '%brick.vehicle' accurately returned the vehicle's id. I would rather not wait 20 minutes and hope that this code works though...
Any ideas to what's going on?