Instead of "vehicleclassname" use a real class of some vehicle, like "T-80", and walk to a T-80 and execute the script...
Just remember that you need to be closer than one meter of the vehicle...
Classes can be found in the config.. Not sure if there's a list somewhere on BIS vehicles...
And that's just an example code, if you really would like it to return objects you would need to write it as a function (.sqf), maybe give the function user a possibility to set the distance from the player on which spot the search is to be done etc, and forget about that
count stuff...