I am using the SunShine Autos system, but there is no purchase limit and I could only find
// Empty string for our output.
local output = "";
// Var to count how many vehicles the player ownes.
local count = 0;
// Iterate the array, using a foreach loop.
foreach ( obj in this[ MyArray ] )
if ( obj != null )
// Add the object properties to a tmp variable, so we can access squirrel's VM built in manipulation functions for that data type.
local tmp = obj.IsPurchased;
// Check the value is not null or empty
if ( ( tmp != null ) && ( tmp.len() > 0 ) )
// Perform a string comparison, if we get a match, increase our counter.
if ( tmp.find( player ) != null ) count++;
if( HowManyCars(player) >= 2 )
MessagePlayer("You have enough vehicles",player);
// return count as integer.