Hi,
the format command only casts (creates) a string from other variable types. In order to execute the string as code you also have to use the call command. This should work:
max=3
cont=0
#bucle
call format ["car%1 = 1",cont]
cont = cont + 1;
?(cont==max):exit
goto "bucle"